Beispiel #1
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Beispiel #2
0
    AudioSource stingSource;            //Reference to the generated sting Audio Source


    void Awake()
    {
        //If an AudioManager exists and it is not this...
        if (current != null && current != this)
        {
            //...destroy this. There can be only one AudioManager
            Destroy(gameObject);
            return;
        }

        //This is the current AudioManager and it should persist between scene loads
        current = this;
        DontDestroyOnLoad(gameObject);

        //Generate the Audio Source "channels" for our game's audio

        stingSource = gameObject.AddComponent <AudioSource>() as AudioSource;


        //Assign each audio source to its respective mixer group so that it is
        //routed and controlled by the audio mixer

        stingSource.outputAudioMixerGroup = stingGroup;
    }
Beispiel #3
0
 public void playClick()
 {
     AudioManagerMenu.playButtonClick();
 }
Beispiel #4
0
 public void playHover()
 {
     AudioManagerMenu.playButtonHover();
 }