void Start() { m_currentMenu = m_defaultMenu; if (m_showMenus) { ShowCurrentMenu(); } m_navigationWaitTime = m_navigationDelay; m_menuAudio = GetComponentInChildren <MenuAudioManager>(); }
private void Awake() { if (!menuAudioManager) { menuAudioManager = this; } else { Destroy(this.gameObject); } }
void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); return; } //DontDestroyOnLoad(gameObject); }
void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); return; } else { _instance = this; } DontDestroyOnLoad(this.gameObject); }
// Use this for initialization void Awake() { // Keep the game object Active between scenes if (Instance != null) { Destroy(gameObject); } else { Instance = this; DontDestroyOnLoad(gameObject); } foreach (var Audio in MenuSounds) { Audio.source = gameObject.AddComponent <AudioSource>(); Audio.source.clip = Audio.clip; Audio.source.outputAudioMixerGroup = Group; } Stop(); }
private void Awake() { Instance = this; }