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