Advertisement
apieceoffruit

Unity Bootstrapping

May 25th, 2024
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1.     public static class BootstrapApplication
  2.     {
  3.         [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
  4.         public static void Initialize()
  5.         {
  6.             var gameManagers = Resources.Load<GameManagers>(GAMEMANAGERS);
  7.             var instance = Object.Instantiate(gameManagers);
  8.             instance.name = GAMEMANAGERS;
  9.             Object.DontDestroyOnLoad(instance);
  10.  
  11.         }
  12.         const string GAMEMANAGERS = "GameManagers";
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement