Example #1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         if (MapGenerator.Generated && !Loaded) { Load(); }
     }
     else { Destroy(this); }
 }
Example #2
0
 private void OnDestroy()
 {
     if (HighLogic.LoadedScene == GameScenes.MAINMENU && loaded)
     {
         instance = null;
         ResourceController.Instance.UnloadResources();
         loaded = false;
         DebugWindow.Instance.Print("- Unloaded Resources -");
     }
 }