You can add this class to a slider in your UI and it'll let you control a target Track volume via the MMSoundManager
More...
|
MMSoundManager.MMSoundManagerTracks | Track |
| The track to change volume on. More...
|
|
float | MinVolume = 0f |
| The volume to apply to the track when the slider is at its minimum. More...
|
|
float | MaxVolume = 1f |
| The volume to apply to the track when the slider is at its maximum. More...
|
|
Modes | Mode = Modes.Write |
| in read mode, the value of the slider will be applied to the volume of the track. in read mode, the slider will move to reflect the volume of the track More...
|
|
bool | ChangeModeOnTrackFade = true |
| if this is true, the slider will automatically switch to read mode for the required duration when a track fade event is caught More...
|
|
bool | ChangeModeOnMute = true |
| if this is true, the slider will automatically switch to read mode for the required duration when a track mute event is caught More...
|
|
bool | ChangeModeOnUnmute = true |
| if this is true, the slider will automatically switch to read mode for the required duration when a track unmute event is caught More...
|
|
bool | ChangeModeOnTrackVolumeChange = false |
| if this is true, the slider will automatically switch to read mode for the required duration when a track volume change event is caught More...
|
|
float | ModeSwitchBufferTime = 0.1f |
| when switching automatically (and temporarily) to Read Mode, the minimum duration the slider will remain in that mode More...
|
|
|
virtual void | Awake () |
| On awake we cache our slider More...
|
|
virtual void | LateUpdate () |
| On late update, we update our slider's value if in read mode, and reset our mode if needed More...
|
|
virtual void | OnEnable () |
| On enable we start listening for events More...
|
|
virtual void | OnDisable () |
| On disable we stop listening for events More...
|
|
You can add this class to a slider in your UI and it'll let you control a target Track volume via the MMSoundManager
◆ Modes
The possible modes this slider can be in
- Read : the slider will move to reflect the volume of the track
- Write : the value of the slider will be applied to the volume of the track This slider can also listen for events (mute, unmute, fade, volume change) and automatically switch to read mode if one is caught. This means that most of the time, the slider is in write mode, and switches to read mode only when needed, to be always accurate
◆ Awake()
virtual void MoreMountains.Tools.MMSoundManagerTrackVolumeSlider.Awake |
( |
| ) |
|
|
protectedvirtual |
On awake we cache our slider
◆ ChangeModeToRead()
virtual void MoreMountains.Tools.MMSoundManagerTrackVolumeSlider.ChangeModeToRead |
( |
float |
duration | ) |
|
|
virtual |
A public method you can use to switch to read mode for a limited time, resetting to write after that
- Parameters
-
◆ LateUpdate()
virtual void MoreMountains.Tools.MMSoundManagerTrackVolumeSlider.LateUpdate |
( |
| ) |
|
|
protectedvirtual |
On late update, we update our slider's value if in read mode, and reset our mode if needed
◆ OnDisable()
virtual void MoreMountains.Tools.MMSoundManagerTrackVolumeSlider.OnDisable |
( |
| ) |
|
|
protectedvirtual |
On disable we stop listening for events
◆ OnEnable()
virtual void MoreMountains.Tools.MMSoundManagerTrackVolumeSlider.OnEnable |
( |
| ) |
|
|
protectedvirtual |
On enable we start listening for events
◆ OnMMEvent() [1/3]
void MoreMountains.Tools.MMSoundManagerTrackVolumeSlider.OnMMEvent |
( |
MMSoundManagerEvent |
soundManagerEvent | ) |
|
When we get an event letting us know the settings have been loaded, we update our slider to reflect the current track volume
- Parameters
-
◆ OnMMEvent() [2/3]
if we grab a track event, we switch to read mode if needed
- Parameters
-
◆ OnMMEvent() [3/3]
if we grab a track fade event, we switch to read mode if needed
- Parameters
-
◆ UpdateSliderValueWithTrackVolume()
virtual void MoreMountains.Tools.MMSoundManagerTrackVolumeSlider.UpdateSliderValueWithTrackVolume |
( |
| ) |
|
|
virtual |
Updates the slider value to reflect the current track volume
◆ UpdateVolume()
virtual void MoreMountains.Tools.MMSoundManagerTrackVolumeSlider.UpdateVolume |
( |
float |
newValue | ) |
|
|
virtual |
Bind your slider to this method
◆ _resetNeeded
bool MoreMountains.Tools.MMSoundManagerTrackVolumeSlider._resetNeeded = false |
|
protected |
◆ _resetTimestamp
float MoreMountains.Tools.MMSoundManagerTrackVolumeSlider._resetTimestamp |
|
protected |
◆ _resetToMode
Modes MoreMountains.Tools.MMSoundManagerTrackVolumeSlider._resetToMode |
|
protected |
◆ _slider
Slider MoreMountains.Tools.MMSoundManagerTrackVolumeSlider._slider |
|
protected |
◆ ChangeModeOnMute
bool MoreMountains.Tools.MMSoundManagerTrackVolumeSlider.ChangeModeOnMute = true |
if this is true, the slider will automatically switch to read mode for the required duration when a track mute event is caught
◆ ChangeModeOnTrackFade
bool MoreMountains.Tools.MMSoundManagerTrackVolumeSlider.ChangeModeOnTrackFade = true |
if this is true, the slider will automatically switch to read mode for the required duration when a track fade event is caught
◆ ChangeModeOnTrackVolumeChange
bool MoreMountains.Tools.MMSoundManagerTrackVolumeSlider.ChangeModeOnTrackVolumeChange = false |
if this is true, the slider will automatically switch to read mode for the required duration when a track volume change event is caught
◆ ChangeModeOnUnmute
bool MoreMountains.Tools.MMSoundManagerTrackVolumeSlider.ChangeModeOnUnmute = true |
if this is true, the slider will automatically switch to read mode for the required duration when a track unmute event is caught
◆ MaxVolume
float MoreMountains.Tools.MMSoundManagerTrackVolumeSlider.MaxVolume = 1f |
The volume to apply to the track when the slider is at its maximum.
◆ MinVolume
float MoreMountains.Tools.MMSoundManagerTrackVolumeSlider.MinVolume = 0f |
The volume to apply to the track when the slider is at its minimum.
◆ Mode
in read mode, the value of the slider will be applied to the volume of the track. in read mode, the slider will move to reflect the volume of the track
◆ ModeSwitchBufferTime
float MoreMountains.Tools.MMSoundManagerTrackVolumeSlider.ModeSwitchBufferTime = 0.1f |
when switching automatically (and temporarily) to Read Mode, the minimum duration the slider will remain in that mode
◆ Track
The track to change volume on.
The documentation for this class was generated from the following file: