Beispiel #1
0
 void Start()
 {
     //caching
     audioManager = AudioManagerBrackyes.instance;
     if (audioManager == null)
     {
         Debug.LogError("FREAK OUT, No audio manager found in the scene");
     }
 }
    void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
        }
        else
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }

        //Finds sounds, outputs to mixer group
        foreach (Sound s in sounds)
        {
            s.source      = gameObject.AddComponent <AudioSource>();
            s.source.clip = s.clip;
            s.source.loop = s.loop;

            s.source.outputAudioMixerGroup = mixerGroup;
        }
    }