コード例 #1
0
 /// <summary>
 /// On disable, stops listening for playlist events
 /// </summary>
 protected virtual void OnDisable()
 {
     MMPlaylistPauseEvent.Unregister(OnPauseEvent);
     MMPlaylistPlayEvent.Unregister(OnPlayEvent);
     MMPlaylistPlayNextEvent.Unregister(OnPlayNextEvent);
     MMPlaylistStopEvent.Unregister(OnStopEvent);
     MMPlaylistPlayIndexEvent.Unregister(OnPlayIndexEvent);
 }
コード例 #2
0
 /// <summary>
 /// On enable, starts listening for playlist events
 /// </summary>
 protected virtual void OnEnable()
 {
     MMPlaylistPauseEvent.Register(OnPauseEvent);
     MMPlaylistPlayEvent.Register(OnPlayEvent);
     MMPlaylistPlayNextEvent.Register(OnPlayNextEvent);
     MMPlaylistPlayPreviousEvent.Register(OnPlayPreviousEvent);
     MMPlaylistStopEvent.Register(OnStopEvent);
     MMPlaylistPlayIndexEvent.Register(OnPlayIndexEvent);
 }
コード例 #3
0
 /// <summary>
 /// Plays the track set in parameters
 /// </summary>
 public virtual void PlayTrack(int trackIndex)
 {
     MMPlaylistPlayIndexEvent.Trigger(trackIndex);
 }
コード例 #4
0
 /// <summary>
 /// Plays the track selected in the inspector
 /// </summary>
 public virtual void PlaySelectedTrack()
 {
     MMPlaylistPlayIndexEvent.Trigger(TrackNumber);
 }