|
Init(args)
Scripting Reference
|
◆ Awake()
Awake is called when the script instance is being loaded and handles calling the Init method with the TWrapped argument. Awake is called when a Scene containing a reference to the scriptable object asset loads, or when a new instance of the ScriptableObject is created. Unity calls Awake only once during the lifetime of the script instance. A script's lifetime lasts until the Scene that contains it is unloaded. If the Scene is loaded again, Unity loads the script instance again, so Awake will be called again. If the Scene is loaded multiple times additively, Unity loads several script instances, so Awake will be called several times (once on each instance). Note: Use Awake instead of the constructor for initialization, as the serialized state of the ScriptableObject is undefined at construction time. |