void OnDestroy() { if (_inst == this) { _inst = null; } }
void Awake() { enabled = GameSettings.Instance.IsDeferredShadingActived(); if (_inst != null) { Debug.LogError("UIRenderer Singleton error!"); return; } _inst = this; }
// Destroy world map public void DestroyWorldMap() { if (_activeWorldmap != null) { _activeWorldmap.SetActive(false); } SoundManager.Instance.PlayBGM("town_theme.mp3", 1.0f); CameraController.Instance.gameObject.SetActive(true); CustomUIRenderer.SetEnable(true); }
// Create world map. public void CreateWorldMap(int worldmapIdx) { ActiveWorldMap(worldmapIdx); CameraController.Instance.gameObject.SetActive(false); CustomUIRenderer.SetEnable(false); SoundManager.Instance.PlayBGM(_bgMusic, 1.0f); UpdateLevelButtonsState(); }