Differences
This shows you the differences between two versions of the page.
Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
runtimeinitializeonload [2021/08/31 14:55] 73.95.178.156 |
runtimeinitializeonload [2022/01/26 04:23] (current) 187.190.156.255 |
| |
Methods with RuntimeInitializeLoadType.AfterSceneLoad, or RuntimeInitializeLoadType.BeforeSceneLoad will only be called for the **first** scene in a run of the application, not every scene. ((Tested in Unity 2019.4.19f1, in editor and in Android build)) | Methods with RuntimeInitializeLoadType.AfterSceneLoad, or RuntimeInitializeLoadType.BeforeSceneLoad will only be called for the **first** scene in a run of the application, not every scene. ((Tested in Unity 2019.4.19f1, in editor and in Android build)) |
| |
| Another important thing is that the method should be static! |
---- | ---- |
| |
===== Other Nuanced Info ===== | ===== Other Nuanced Info ===== |
| |
If you create a GameObject and attach a MonoBehaviour to it in "BeforeSceneLoad", or another early LoadType, the Awake function of that MonoBehavior WILL be called at the point of creating the GameObject. In other words, the Awake will be called earlier than the Awakes of GameObjects in Loaded((tested in 2021.1.15f1). | If you create a GameObject and attach a MonoBehaviour to it in "BeforeSceneLoad", or another early LoadType, the Awake function of that MonoBehavior WILL be called at the point of creating the GameObject. In other words, the Awake will be called earlier than the Awakes of GameObjects in Loaded((tested in 2021.1.15f1)). |
| |
Example: | Example: |