Пример #1
0
 /// <summary>
 /// On enable we start listening for events
 /// </summary>
 protected virtual void OnEnable()
 {
     MMSfxEvent.Register(OnMMSfxEvent);
     MMSoundManagerSoundPlayEvent.Register(OnMMSoundManagerSoundPlayEvent);
     this.MMEventStartListening <MMSoundManagerEvent>();
     this.MMEventStartListening <MMSoundManagerTrackEvent>();
     this.MMEventStartListening <MMSoundManagerSoundControlEvent>();
     this.MMEventStartListening <MMSoundManagerTrackFadeEvent>();
     this.MMEventStartListening <MMSoundManagerSoundFadeEvent>();
     this.MMEventStartListening <MMSoundManagerAllSoundsControlEvent>();
 }
Пример #2
0
 /// <summary>
 /// On disable we stop listening for events
 /// </summary>
 protected virtual void OnDisable()
 {
     if (_enabled)
     {
         MMSfxEvent.Unregister(OnMMSfxEvent);
         MMSoundManagerSoundPlayEvent.Unregister(OnMMSoundManagerSoundPlayEvent);
         this.MMEventStopListening <MMSoundManagerEvent>();
         this.MMEventStopListening <MMSoundManagerTrackEvent>();
         this.MMEventStopListening <MMSoundManagerSoundControlEvent>();
         this.MMEventStopListening <MMSoundManagerTrackFadeEvent>();
         this.MMEventStopListening <MMSoundManagerSoundFadeEvent>();
         this.MMEventStopListening <MMSoundManagerAllSoundsControlEvent>();
     }
 }