Uninomicon

Documenting the dark corners of the Unity Engine.

User Tools

Site Tools


runtimeinitializeonload

This is an old revision of the document!


RuntimeInitializeOnLoad

The documentation is not correct about this function running after awake. It does by default, but not if you specify a load type:

The order of callbacks is: 1)

  • SubsystemRegistration
  • AfterAssembliesLoad
  • BeforeSplashScreen2)
  • BeforeSceneLoad
  • Unity MonoBehaviour.Awake() runs here
  • AfterSceneLoad, Default

Providing no load type defaults to running the function after Awake.

1)
tested in the editor, 2020.2.1f1
2)
On 2019, this call didn't seem to run in the editor, I think this was fixed with the addition of the previous two load types.
runtimeinitializeonload.1618370016.txt.gz · Last modified: 2021/04/14 03:13 by 73.95.178.156