Last active
July 10, 2022 02:44
-
-
Save OwenMagelssen/146a6d6a2874e716d7f8b5ceab2d1a2e to your computer and use it in GitHub Desktop.
System initializer for Unity taken from Tarodev (https://www.youtube.com/watch?v=zJOxWmVveXU)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public static class SystemsLoader | |
{ | |
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] | |
public static void Execute() | |
{ | |
var systems = Resources.Load("Systems"); | |
if (!systems) | |
return; | |
Object.DontDestroyOnLoad(Object.Instantiate(systems)); | |
Debug.Log("Systems Loaded"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment