![]() |
Feel 5.9.1
The best way to improve your game's feel and make it extra juicy
|
Public Types | |
| enum | PlaylistManagerStates { Idle , Playing , Paused } |
| the possible states this playlist can be in More... | |
Public Member Functions | |
| delegate void | PlaylistEvent () |
| a delegate used to trigger events along the lifecycle of the playlist manager | |
| virtual void | Play () |
| Use this method to either play the first song of the playlist, or resume after a pause. | |
| virtual void | PlaySongAt (int songIndex) |
| Plays the song at the specified index. | |
| virtual void | Pause () |
| Pauses the current song. | |
| virtual void | Stop () |
| Stops the song currently playing. | |
| virtual void | StopWithFade (bool withFade=true) |
| Stops the current song, lets you specify whether or not to fade it out. | |
| virtual void | SetCurrentSongLoop (bool loop) |
| Will change the current song's loop status. | |
| virtual void | PlayNextSong () |
| Plays the next song in the playlist. | |
| virtual void | PlayPreviousSong () |
| Plays the previous song in the playlist. | |
| virtual void | QueueSongAtIndex (int songIndex) |
| Queues the song at the specified index to play once the currently playing song finishes. | |
| virtual void | ChangePlaylist (MMSMPlaylist newPlaylist) |
| Changes the playlist for the specified one, doesn't play a song there, it'll play once the song currently playing ends. | |
| virtual void | ChangePlaylistAndPlay (MMSMPlaylist newPlaylist) |
| Changes the playlist for the specified one, and plays its first song. | |
| virtual void | ResetPlayCount () |
| resets all play counts (playlist and songs) | |
| virtual void | SetVolumeMultiplier (float newVolumeMultiplier) |
| Sets a new volume multiplier. | |
| virtual void | SetPitchMultiplier (float newPitchMultiplier) |
| Sets a new pitch multiplier. | |
| virtual void | StartListening () |
| Starts listening for events. | |
| virtual void | StopListening () |
| Stops listening for events. | |
Public Attributes | |
| int | Channel = 0 |
| the channel used to target this playlist manager by playlist remote or playlist feedbacks | |
| MMSMPlaylist | Playlist |
| the current playlist this manager will play | |
| bool | PlayOnStart = false |
| whether this playlist manager should auto play on start or not | |
| float | VolumeMultiplier = 1f |
| a global volume multiplier to apply when playing a song | |
| float | PitchMultiplier = 1f |
| a pitch multiplier to apply to all songs when playing them | |
| bool | Persistent = false |
| if this is true, this playlist manager will persist from scene to scene and will keep playing | |
| bool | AutomaticallyUnparentOnAwake = true |
| if this is true, this singleton will auto detach if it finds itself parented on awake | |
| bool | AutoHandleApplicationPause = true |
| if this is true, this playlist will automatically pause/resume OnApplicationPause, useful if you've prevented your game from running in the background | |
| bool | FadeIn |
| whether or not sounds should fade in when they start playing | |
| bool | FadeOut |
| whether or not sounds should fade out when they stop playing | |
| float | FadeDuration = 1f |
| the duration of the fade, in seconds | |
| MMTweenType | FadeTween = new MMTweenType(MMTween.MMTweenCurve.EaseInCubic) |
| the tween to use when fading the sound | |
| bool | BindPitchToTimeScale = false |
| whether or not the playlist manager should have its pitch multiplier value driven by the current timescale. If set to true, songs would appear to slow down when time is slowed down, and to speed up when time scale is higher than normal | |
| Vector2 | TimescaleRemapFrom = new Vector2(0f,2f) |
| the values to remap timescale from (min and max) - when timescale is equal to TimescaleRemapFrom.x, the pitch multiplier will be TimescaleRemapTo.x | |
| Vector2 | TimescaleRemapTo = new Vector2(0.8f,1.2f) |
| the values to remap timescale to (min and max) - when timescale is equal to TimescaleRemapFrom.x, the pitch multiplier will be TimescaleRemapTo.x | |
| PlaylistManagerStates | DebugCurrentManagerState = PlaylistManagerStates.Idle |
| the current state of the playlist, debug display only | |
| int | CurrentSongIndex = -1 |
| the index we're currently playing | |
| string | CurrentSongName |
| the name of the song that is currently playing | |
| MMStateMachine< PlaylistManagerStates > | PlaylistManagerState |
| the current state of this playlist | |
| float | CurrentTime |
| the time of the currently playing song | |
| float | CurrentTimeLeft |
| the time (in seconds) left on the song currently playing | |
| float | CurrentClipDuration |
| the total duration of the song currently playing | |
| float | CurrentProgress = 0 |
| the current normalized progress of the song currently playing | |
| bool | PlayButton |
| a play test button | |
| bool | StopButton |
| a stop test button | |
| bool | PauseButton |
| a pause test button | |
| bool | PreviousButton |
| a next song test button | |
| bool | NextButton |
| a next song test button | |
| int | TargetSongIndex = 0 |
| the index of the song to play when pressing the PlayTargetSong button | |
| bool | TargetSongButton |
| a next song test button | |
| bool | QueueTargetSongButton |
| a next song test button | |
| bool | SetLoopTargetSongButton |
| a next song test button | |
| bool | StopLoopTargetSongButton |
| a next song test button | |
| MMSMPlaylist | TestPlaylist |
| a playlist you can set to use with the SetTargetPlaylist and PlayTargetPlaylist buttons | |
| bool | SetTargetPlaylistButton |
| a test button used to set a new playlist | |
| bool | PlayTargetPlaylistButton |
| a test button used to play the target playlist | |
| bool | ResetPlayCountButton |
| a test button used to reset the play count | |
| float | TestVolumeControl = 1f |
| a slider used to test volume control | |
| float | TestPlaybackSpeedControl = 1f |
| a slider used to test speed control | |
| PlaylistEvent | OnSongStart |
| an event that gets triggered when a song starts | |
| PlaylistEvent | OnSongEnd |
| an event that gets triggered when a song ends | |
| PlaylistEvent | OnPause |
| an event that gets triggered when the playlist gets paused | |
| PlaylistEvent | OnStop |
| an event that gets triggered when the playlist gets stopped | |
| PlaylistEvent | OnPlaylistChange |
| an event that gets triggered when the playlist gets changed for another one | |
| PlaylistEvent | OnPlaylistEnd |
| an event that gets triggered when a playlist ends | |
Protected Member Functions | |
| virtual void | Awake () |
| On awake, we check if there's already a copy of the object in the scene. If there's one, we destroy it. | |
| virtual void | InitializeSingleton () |
| Initializes the singleton. | |
| virtual void | Start () |
| On Start we initialize our playlist. | |
| virtual void | Initialization () |
| On init we initialize our state machine and start playing if needed. | |
| virtual void | InitializeRandomSeed () |
| Initializes the random seed if needed. | |
| virtual void | InitializePlaylistManagerState () |
| Inits the state machine. | |
| virtual void | ChangePlaylistManagerState (PlaylistManagerStates newManagerState) |
| a method used to update the state machine | |
| virtual void | Update () |
| on update, self disables if needed, | |
| virtual void | HandleTimescale () |
| On update, we update our pitch multiplier to match our timescale if necessary. | |
| virtual void | UpdateTimeAndProgress () |
| Updates the various time counters. | |
| virtual void | PlayFirstSong () |
| Picks and plays the first song. | |
| virtual void | HandleEndOfSong () |
| Detects end of song and moves on to the next one. | |
| virtual void | HandleNextSong (int direction, bool bypassLoop) |
| Determines the next song to play and triggers the play. | |
| virtual void | HandleEndOfPlaylist () |
| Handles the end of playlist, triggers a new one if needed. | |
| virtual void | SetTargetPlaylist () |
| a debug method used by the inspector to set the target playlist | |
| virtual void | PlayTargetPlaylist () |
| a debug method used by the inspector to play the target playlist | |
| virtual void | QueueTargetSong () |
| a debug method used by the inspector to queue the specified song | |
| virtual void | PlayTargetSong () |
| a debug method used by the inspector to play the specified song | |
| virtual void | SetCurrentSongToLoop () |
| a test method used by the inspector debug button to force the current song from looping | |
| virtual void | StopCurrentSongFromLooping () |
| a test method used by the inspector debug button to prevent the current song from looping | |
| virtual void | OnPlayEvent (int channel) |
| virtual void | OnPauseEvent (int channel) |
| virtual void | OnStopEvent (int channel) |
| virtual void | OnPlayNextEvent (int channel) |
| virtual void | OnPlayPreviousEvent (int channel) |
| virtual void | OnPlayIndexEvent (int channel, int index) |
| virtual void | OnMMPlaylistVolumeMultiplierEvent (int channel, float newVolumeMultiplier, bool applyVolumeMultiplierInstantly=false) |
| virtual void | OnMMPlaylistPitchMultiplierEvent (int channel, float newPitchMultiplier, bool applyPitchMultiplierInstantly=false) |
| virtual void | OnMMPlaylistChangeEvent (int channel, MMSMPlaylist newPlaylist, bool andPlay) |
| virtual void | OnDestroy () |
| on destroy we stop listening for events | |
| virtual void | OnApplicationPause (bool pauseStatus) |
| On ApplicationPause, we pause the playlist and resume it afterwards. | |
Protected Attributes | |
| bool | _shouldResumeOnApplicationPause = false |
| int | _queuedSongIndex = -1 |
| AudioSource | _currentlyPlayingAudioSource |
| MMSoundManagerPlayOptions | _options |
| float | _lastTestVolumeControl = 1f |
| float | _lastTestPlaybackSpeedControl = 1f |
Static Protected Attributes | |
| static MMSMPlaylistManager | _instance |
Properties | |
| virtual bool | IsPlaying [get] |
| whether or not this playlist manager is currently playing | |
| static bool | HasInstance [get] |
| static MMSMPlaylistManager | Current [get] |
| static MMSMPlaylistManager | Instance [get] |
| Singleton design pattern. | |
|
protectedvirtual |
On awake, we check if there's already a copy of the object in the scene. If there's one, we destroy it.
|
virtual |
Changes the playlist for the specified one, doesn't play a song there, it'll play once the song currently playing ends.
| newPlaylist |
|
virtual |
Changes the playlist for the specified one, and plays its first song.
| newPlaylist |
|
protectedvirtual |
a method used to update the state machine
| newManagerState |
|
protectedvirtual |
Handles the end of playlist, triggers a new one if needed.
|
protectedvirtual |
Detects end of song and moves on to the next one.
|
protectedvirtual |
Determines the next song to play and triggers the play.
| direction |
|
protectedvirtual |
On update, we update our pitch multiplier to match our timescale if necessary.
|
protectedvirtual |
On init we initialize our state machine and start playing if needed.
|
protectedvirtual |
Inits the state machine.
|
protectedvirtual |
Initializes the random seed if needed.
|
protectedvirtual |
Initializes the singleton.
|
protectedvirtual |
On ApplicationPause, we pause the playlist and resume it afterwards.
| pauseStatus |
|
protectedvirtual |
on destroy we stop listening for events
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Pauses the current song.
|
virtual |
Use this method to either play the first song of the playlist, or resume after a pause.
|
protectedvirtual |
Picks and plays the first song.
| delegate void MoreMountains.Tools.MMSMPlaylistManager.PlaylistEvent | ( | ) |
a delegate used to trigger events along the lifecycle of the playlist manager
|
virtual |
Plays the next song in the playlist.
|
virtual |
Plays the previous song in the playlist.
|
virtual |
Plays the song at the specified index.
| index |
|
protectedvirtual |
a debug method used by the inspector to play the target playlist
|
protectedvirtual |
a debug method used by the inspector to play the specified song
|
virtual |
Queues the song at the specified index to play once the currently playing song finishes.
| songIndex |
|
protectedvirtual |
a debug method used by the inspector to queue the specified song
|
virtual |
resets all play counts (playlist and songs)
|
virtual |
Will change the current song's loop status.
|
protectedvirtual |
a test method used by the inspector debug button to force the current song from looping
|
virtual |
Sets a new pitch multiplier.
| newPitchMultiplier |
|
protectedvirtual |
a debug method used by the inspector to set the target playlist
|
virtual |
Sets a new volume multiplier.
| newVolumeMultiplier |
|
protectedvirtual |
On Start we initialize our playlist.
|
virtual |
Starts listening for events.
|
virtual |
Stops the song currently playing.
|
protectedvirtual |
a test method used by the inspector debug button to prevent the current song from looping
|
virtual |
Stops listening for events.
|
virtual |
Stops the current song, lets you specify whether or not to fade it out.
|
protectedvirtual |
on update, self disables if needed,
|
protectedvirtual |
Updates the various time counters.
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| bool MoreMountains.Tools.MMSMPlaylistManager.AutoHandleApplicationPause = true |
if this is true, this playlist will automatically pause/resume OnApplicationPause, useful if you've prevented your game from running in the background
| bool MoreMountains.Tools.MMSMPlaylistManager.AutomaticallyUnparentOnAwake = true |
if this is true, this singleton will auto detach if it finds itself parented on awake
| bool MoreMountains.Tools.MMSMPlaylistManager.BindPitchToTimeScale = false |
whether or not the playlist manager should have its pitch multiplier value driven by the current timescale. If set to true, songs would appear to slow down when time is slowed down, and to speed up when time scale is higher than normal
| int MoreMountains.Tools.MMSMPlaylistManager.Channel = 0 |
the channel used to target this playlist manager by playlist remote or playlist feedbacks
| float MoreMountains.Tools.MMSMPlaylistManager.CurrentClipDuration |
the total duration of the song currently playing
| float MoreMountains.Tools.MMSMPlaylistManager.CurrentProgress = 0 |
the current normalized progress of the song currently playing
| int MoreMountains.Tools.MMSMPlaylistManager.CurrentSongIndex = -1 |
the index we're currently playing
| string MoreMountains.Tools.MMSMPlaylistManager.CurrentSongName |
the name of the song that is currently playing
| float MoreMountains.Tools.MMSMPlaylistManager.CurrentTime |
the time of the currently playing song
| float MoreMountains.Tools.MMSMPlaylistManager.CurrentTimeLeft |
the time (in seconds) left on the song currently playing
| PlaylistManagerStates MoreMountains.Tools.MMSMPlaylistManager.DebugCurrentManagerState = PlaylistManagerStates.Idle |
the current state of the playlist, debug display only
| float MoreMountains.Tools.MMSMPlaylistManager.FadeDuration = 1f |
the duration of the fade, in seconds
| bool MoreMountains.Tools.MMSMPlaylistManager.FadeIn |
whether or not sounds should fade in when they start playing
| bool MoreMountains.Tools.MMSMPlaylistManager.FadeOut |
whether or not sounds should fade out when they stop playing
| MMTweenType MoreMountains.Tools.MMSMPlaylistManager.FadeTween = new MMTweenType(MMTween.MMTweenCurve.EaseInCubic) |
the tween to use when fading the sound
| bool MoreMountains.Tools.MMSMPlaylistManager.NextButton |
a next song test button
| PlaylistEvent MoreMountains.Tools.MMSMPlaylistManager.OnPause |
an event that gets triggered when the playlist gets paused
| PlaylistEvent MoreMountains.Tools.MMSMPlaylistManager.OnPlaylistChange |
an event that gets triggered when the playlist gets changed for another one
| PlaylistEvent MoreMountains.Tools.MMSMPlaylistManager.OnPlaylistEnd |
an event that gets triggered when a playlist ends
| PlaylistEvent MoreMountains.Tools.MMSMPlaylistManager.OnSongEnd |
an event that gets triggered when a song ends
| PlaylistEvent MoreMountains.Tools.MMSMPlaylistManager.OnSongStart |
an event that gets triggered when a song starts
| PlaylistEvent MoreMountains.Tools.MMSMPlaylistManager.OnStop |
an event that gets triggered when the playlist gets stopped
| bool MoreMountains.Tools.MMSMPlaylistManager.PauseButton |
a pause test button
| bool MoreMountains.Tools.MMSMPlaylistManager.Persistent = false |
if this is true, this playlist manager will persist from scene to scene and will keep playing
| float MoreMountains.Tools.MMSMPlaylistManager.PitchMultiplier = 1f |
a pitch multiplier to apply to all songs when playing them
| bool MoreMountains.Tools.MMSMPlaylistManager.PlayButton |
a play test button
| MMSMPlaylist MoreMountains.Tools.MMSMPlaylistManager.Playlist |
the current playlist this manager will play
| MMStateMachine<PlaylistManagerStates> MoreMountains.Tools.MMSMPlaylistManager.PlaylistManagerState |
the current state of this playlist
| bool MoreMountains.Tools.MMSMPlaylistManager.PlayOnStart = false |
whether this playlist manager should auto play on start or not
| bool MoreMountains.Tools.MMSMPlaylistManager.PlayTargetPlaylistButton |
a test button used to play the target playlist
| bool MoreMountains.Tools.MMSMPlaylistManager.PreviousButton |
a next song test button
| bool MoreMountains.Tools.MMSMPlaylistManager.QueueTargetSongButton |
a next song test button
| bool MoreMountains.Tools.MMSMPlaylistManager.ResetPlayCountButton |
a test button used to reset the play count
| bool MoreMountains.Tools.MMSMPlaylistManager.SetLoopTargetSongButton |
a next song test button
| bool MoreMountains.Tools.MMSMPlaylistManager.SetTargetPlaylistButton |
a test button used to set a new playlist
| bool MoreMountains.Tools.MMSMPlaylistManager.StopButton |
a stop test button
| bool MoreMountains.Tools.MMSMPlaylistManager.StopLoopTargetSongButton |
a next song test button
| bool MoreMountains.Tools.MMSMPlaylistManager.TargetSongButton |
a next song test button
| int MoreMountains.Tools.MMSMPlaylistManager.TargetSongIndex = 0 |
the index of the song to play when pressing the PlayTargetSong button
| float MoreMountains.Tools.MMSMPlaylistManager.TestPlaybackSpeedControl = 1f |
a slider used to test speed control
| MMSMPlaylist MoreMountains.Tools.MMSMPlaylistManager.TestPlaylist |
a playlist you can set to use with the SetTargetPlaylist and PlayTargetPlaylist buttons
| float MoreMountains.Tools.MMSMPlaylistManager.TestVolumeControl = 1f |
a slider used to test volume control
| Vector2 MoreMountains.Tools.MMSMPlaylistManager.TimescaleRemapFrom = new Vector2(0f,2f) |
the values to remap timescale from (min and max) - when timescale is equal to TimescaleRemapFrom.x, the pitch multiplier will be TimescaleRemapTo.x
| Vector2 MoreMountains.Tools.MMSMPlaylistManager.TimescaleRemapTo = new Vector2(0.8f,1.2f) |
the values to remap timescale to (min and max) - when timescale is equal to TimescaleRemapFrom.x, the pitch multiplier will be TimescaleRemapTo.x
| float MoreMountains.Tools.MMSMPlaylistManager.VolumeMultiplier = 1f |
a global volume multiplier to apply when playing a song
|
staticget |
|
staticget |
|
staticget |
Singleton design pattern.
The instance.
|
get |
whether or not this playlist manager is currently playing