Exemplo n.º 1
0
        private void Awake()
        {
            var backgroundMusic = GameObject.Find("BackgroundMusic");

            if (backgroundMusic != null)
            {
                m_bgMusic = backgroundMusic.GetComponent <BackgroundMusic>();
                if (m_bgMusic != null)
                {
                    m_bgMusic.FadeOut();
                }
            }
        }
Exemplo n.º 2
0
 private void Awake()
 {
     if (Instance != null)
     {
         DestroyImmediate(gameObject);
     }
     else
     {
         DontDestroyOnLoad(gameObject);
         Instance      = this;
         m_audioSource = GetComponent <AudioSource>();
         m_audioSource.ignoreListenerVolume = true;
     }
 }