private void Awake() { var backgroundMusic = GameObject.Find("BackgroundMusic"); if (backgroundMusic != null) { m_bgMusic = backgroundMusic.GetComponent <BackgroundMusic>(); if (m_bgMusic != null) { m_bgMusic.FadeOut(); } } }
private void Awake() { if (Instance != null) { DestroyImmediate(gameObject); } else { DontDestroyOnLoad(gameObject); Instance = this; m_audioSource = GetComponent <AudioSource>(); m_audioSource.ignoreListenerVolume = true; } }