2 ms·
You use this and then register whatever hooks you need. Can run before or after the first scene has been loaded etc. Put the configuration in some ScriptableObj
by Jensson 4y ago
You use this and then register whatever hooks you need. Can run before or after the first scene has been loaded etc. Put the configuration in some ScriptableObject somewhere in the project and load things based on that, or just hard code the things you need.
https://docs.unity3d.com/ScriptReference/RuntimeInitializeOnLoadMethodAttribute.html https://docs.unity3d.com/ScriptReference/RuntimeInitializeOn...
Edit: Alternatively just have a main scene and load/unload the other scenes as sub scenes, and put the application level objects in the main scene. Or use the above attribute and spawn the global objects and mark those object as "dont destroy on load" to make them survive the simple scene transitions. Or use normal C# static objects. There are so many ways to handle this, unity doesn't really block you from doing things, just code whatever you need.