void OnEnterTitle(AzumiEventType azumiEventType, Component Sender, object Param = null) { if (musicEnabled) { AudioEventManager.PostEvent(AudioEventType.MainThemeHardStart, this); } }
void OnLevelLost(AzumiEventType azumiEventType, Component Sender, object Param = null) { if (musicEnabled) { AudioEventManager.PostEvent(AudioEventType.LevelThemeFadeOut, this); AudioEventManager.PostEvent(AudioEventType.LossThemeHardStart, this); } }
//----------------------------------------------------------- #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); } }
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++; } } }