Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 729 Bytes

Injected-Components-In-Asset-Bundles.md

File metadata and controls

16 lines (11 loc) · 729 Bytes

Injected Components in Asset Bundles

Injected components can be used in asset bundles.

How-to

  • Your class must meet the critereon mentioned in Class Injection.
  • Add a dummy script for your component into Unity. Remove any methods, constructors, and properties. Fields can optionally be left in for future deserialization support.
  • Apply the component to your intended objects in Unity and build the asset bundle.
  • At runtime, register your component with RegisterTypeInIl2Cpp before loading any objects from the asset bundle.

Limitations

  • Currently, deserialization for component fields is not supported. Any fields on the component will initially have their default value as defined in the mono assembly.