Mscr:Assets.Asset
Public Methods
Init
virtual void Init()
Called during initialization of the Asset, either when created or when loaded from disk. Note that this is called after static initialization, but before Assets are loaded. It's recommended to call anything in here that relies on the contents of static variables, see #Static Initialization.
Static Initialization
Static initialization of Assets is an important topic to understand. Due to the fact that Assets.GetAsset can be called during static initialization, Assets loaded from disk are loaded before the general script static initialization. For that reason, it's important to not rely on any script-defined statics to be available during static initialization and construction of any Asset-derived classes, as all static values will be zero.
If you really need to initialize something using a static, it's recommended to put it in the Init() method.
Asset.Init() before loading in the data.