Uninomicon

Documenting the dark corners of the Unity Engine.

User Tools

Site Tools


runtimeinitializeonload

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
runtimeinitializeonload [2021/08/30 06:16]
andrew900460 Added nuanced info section after discovering interesting behaviour
runtimeinitializeonload [2021/08/31 14:56]
73.95.178.156
Line 20: Line 20:
  
 ===== 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. //(discovered 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:
 <code cs> <code cs>
Line 30: Line 32:
 ---- ----
  
-  * [[https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager-sceneLoaded.html|'SceneManager.sceneLoaded']] event subscribers will also be called BEFORE "AfterSceneLoad". By the name of the event, you may assume that the event is called AFTER the scene was loaded, but it appears to be called just before. //(discovered in 2021.1.15f1)//+[[https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager-sceneLoaded.html|SceneManager.sceneLoaded]] event subscribers will be called before ''AfterSceneLoad''. By the name of the event, you might assume that the event is called **after** the scene was loaded, but it appears to be called just before. ((tested in 2021.1.15f1))
runtimeinitializeonload.txt · Last modified: 2022/01/26 04:23 by 187.190.156.255