Exemplo n.º 1
0
 void OnEnterTitle(AzumiEventType azumiEventType, Component Sender, object Param = null)
 {
     if (musicEnabled)
     {
         AudioEventManager.PostEvent(AudioEventType.MainThemeHardStart, this);
     }
 }
Exemplo n.º 2
0
 void OnLevelLost(AzumiEventType azumiEventType, Component Sender, object Param = null)
 {
     if (musicEnabled)
     {
         AudioEventManager.PostEvent(AudioEventType.LevelThemeFadeOut, this);
         AudioEventManager.PostEvent(AudioEventType.LossThemeHardStart, this);
     }
 }
Exemplo n.º 3
0
 //-----------------------------------------------------------
 #region methods
 //Called at start-up to initialize
 void Awake()
 {
     //If no instance exists, then assign this instance
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject); //Prevent object from being destroyed on scene exit
     }
     else //Instance already exists, so destroy this one. This should be a singleton object
     {
         DestroyImmediate(this);
     }
 }
Exemplo n.º 4
0
        void Start()
        {
            List <AudioEventType> myKeys = new List <AudioEventType>(audioTriggers.Keys);

            for (int i = 0; i < myKeys.Count; i++)
            {
                AudioEventManager.ListenForEvent(myKeys[i], DoAudioEvent);
            }
            if (loopClips.Length > 0)
            {
                audioSources = new AudioSource[loopClips.Length];
                int i = 0;
                while (i < loopClips.Length)
                {
                    GameObject child = new GameObject("LoopPlayer");
                    child.transform.parent = gameObject.transform;
                    audioSources[i]        = child.AddComponent <AudioSource>();
                    audioSources[i].outputAudioMixerGroup = mixerGroup;
                    i++;
                }
            }
        }