Feel  3.16
The best way to improve your game's feel and make it extra juicy
MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound Class Reference

This feedback will let you play a sound via the MMSoundManager. You will need a game object in your scene with a MMSoundManager object on it for this to work. More...

Inheritance diagram for MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound:
MoreMountains.Feedbacks.MMFeedback

Public Attributes

AudioClip Sfx
 the sound clip to play More...
 
AudioClip[] RandomSfx
 an array to pick a random sfx from More...
 
bool TestButton
 
bool TestStopButton
 
float MinVolume = 1f
 the minimum volume to play the sound at More...
 
float MaxVolume = 1f
 the maximum volume to play the sound at More...
 
float MinPitch = 1f
 the minimum pitch to play the sound at More...
 
float MaxPitch = 1f
 the maximum pitch to play the sound at More...
 
MMSoundManager.MMSoundManagerTracks MmSoundManagerTrack = MMSoundManager.MMSoundManagerTracks.Sfx
 the track on which to play the sound. Pick the one that matches the nature of your sound More...
 
int ID = 0
 the ID of the sound. This is useful if you plan on using sound control feedbacks on it afterwards. More...
 
AudioMixerGroup AudioGroup = null
 the AudioGroup on which to play the sound. If you're already targeting a preset track, you can leave it blank, otherwise the group you specify here will override it. More...
 
AudioSource RecycleAudioSource = null
 if (for some reason) you've already got an audiosource and wouldn't like to use the built-in pool system, you can specify it here More...
 
bool Loop = false
 whether or not this sound should loop More...
 
bool Persistent = false
 whether or not this sound should continue playing when transitioning to another scene More...
 
bool DoNotPlayIfClipAlreadyPlaying = false
 whether or not this sound should play if the same sound clip is already playing More...
 
bool StopSoundOnFeedbackStop = false
 if this is true, this sound will stop playing when stopping the feedback More...
 
bool DoNotAutoRecycleIfNotDonePlaying = false
 if this is true, this sound won't be recycled if it's not done playing More...
 
bool Fade = false
 whether or not to fade this sound in when playing it More...
 
float FadeInitialVolume = 0f
 if fading, the volume at which to start the fade More...
 
float FadeDuration = 1f
 if fading, the duration of the fade, in seconds More...
 
MMTweenType FadeTween = new MMTweenType(MMTween.MMTweenCurve.EaseInOutQuartic)
 if fading, the tween over which to fade the sound More...
 
bool SoloSingleTrack = false
 whether or not this sound should play in solo mode over its destination track. If yes, all other sounds on that track will be muted when this sound starts playing More...
 
bool SoloAllTracks = false
 whether or not this sound should play in solo mode over all other tracks. If yes, all other tracks will be muted when this sound starts playing More...
 
bool AutoUnSoloOnEnd = false
 if in any of the above solo modes, AutoUnSoloOnEnd will unmute the track(s) automatically once that sound stops playing More...
 
float PanStereo
 Pans a playing sound in a stereo way (left or right). This only applies to sounds that are Mono or Stereo. More...
 
float SpatialBlend
 Sets how much this AudioSource is affected by 3D spatialisation calculations (attenuation, doppler etc). 0.0 makes the sound full 2D, 1.0 makes it full 3D. More...
 
bool BypassEffects = false
 Bypass effects (Applied from filter components or global listener filters). More...
 
bool BypassListenerEffects = false
 When set global effects on the AudioListener will not be applied to the audio signal generated by the AudioSource. Does not apply if the AudioSource is playing into a mixer group. More...
 
bool BypassReverbZones = false
 When set doesn't route the signal from an AudioSource into the global reverb associated with reverb zones. More...
 
int Priority = 128
 Sets the priority of the AudioSource. More...
 
float ReverbZoneMix = 1f
 The amount by which the signal from the AudioSource will be mixed into the global reverb associated with the Reverb Zones. More...
 
float DopplerLevel = 1f
 Sets the Doppler scale for this AudioSource. More...
 
int Spread = 0
 Sets the spread angle (in degrees) of a 3d stereo or multichannel sound in speaker space. More...
 
AudioRolloffMode RolloffMode = AudioRolloffMode.Logarithmic
 Sets/Gets how the AudioSource attenuates over distance. More...
 
float MinDistance = 1f
 Within the Min distance the AudioSource will cease to grow louder in volume. More...
 
float MaxDistance = 500f
 (Logarithmic rolloff) MaxDistance is the distance a sound stops attenuating at. More...
 
- Public Attributes inherited from MoreMountains.Feedbacks.MMFeedback
bool Active = true
 whether or not this feedback is active More...
 
string Label = "MMFeedback"
 the name of this feedback to display in the inspector More...
 
float Chance = 100f
 the chance of this feedback happening (in percent : 100 : happens all the time, 0 : never happens, 50 : happens once every two calls, etc) More...
 
MMFeedbackTiming Timing
 a number of timing-related values (delay, repeat, etc) More...
 
bool DebugActive = false
 whether or not this feedback is in debug mode More...
 

Static Public Attributes

static bool FeedbackTypeAuthorized = true
 a static bool used to disable all feedbacks of this type at once More...
 

Protected Member Functions

override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 Plays either a random sound or the specified sfx More...
 
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1)
 On Stop, we stop our sound if needed More...
 
virtual void PlaySound (AudioClip sfx, Vector3 position, float intensity)
 Triggers a play sound event More...
 
virtual float GetDuration ()
 Returns the duration of the sound, or of the longest of the random sounds More...
 
virtual async void TestPlaySound ()
 A test method that creates an audiosource, plays it, and destroys itself after play More...
 
virtual void TestStopSound ()
 A test method that stops the test sound More...
 
virtual void PlayAudioSource (AudioSource audioSource, AudioClip sfx, float volume, float pitch, int timeSamples)
 Plays the audio source with the specified volume and pitch More...
 
- Protected Member Functions inherited from MoreMountains.Feedbacks.MMFeedback
virtual void OnEnable ()
 
virtual IEnumerator PlayCoroutine (Vector3 position, float feedbacksIntensity=1.0f)
 An internal coroutine delaying the initial play of the feedback More...
 
virtual void RegularPlay (Vector3 position, float feedbacksIntensity=1.0f)
 Triggers delaying coroutines if needed More...
 
virtual IEnumerator InfinitePlay (Vector3 position, float feedbacksIntensity=1.0f)
 Internal coroutine used for repeated play without end More...
 
virtual IEnumerator RepeatedPlay (Vector3 position, float feedbacksIntensity=1.0f)
 Internal coroutine used for repeated play More...
 
virtual IEnumerator SequenceCoroutine (Vector3 position, float feedbacksIntensity=1.0f)
 A coroutine used to play this feedback on a sequence More...
 
virtual float ApplyDirection (float normalizedTime)
 Returns a new value of the normalized time based on the current play direction of this feedback More...
 
virtual float ApplyTimeMultiplier (float duration)
 Applies the host MMFeedbacks' time multiplier to this feedback More...
 
virtual void CustomInitialization (GameObject owner)
 This method describes all custom initialization processes the feedback requires, in addition to the main Initialization method More...
 
virtual void CustomReset ()
 This method describes what happens when the feedback gets reset More...
 

Protected Attributes

AudioClip _randomClip
 
AudioSource _editorAudioSource
 
MMSoundManagerPlayOptions _options
 
AudioSource _playedAudioSource
 
- Protected Attributes inherited from MoreMountains.Feedbacks.MMFeedback
float _lastPlayTimestamp = -1f
 
int _playsLeft
 
bool _initialized = false
 
Coroutine _playCoroutine
 
Coroutine _infinitePlayCoroutine
 
Coroutine _sequenceCoroutine
 
Coroutine _repeatedPlayCoroutine
 
int _sequenceTrackID = 0
 
MMFeedbacks _hostMMFeedbacks
 
float _beatInterval
 
bool BeatThisFrame = false
 
int LastBeatIndex = 0
 
int CurrentSequenceIndex = 0
 
float LastBeatTimestamp = 0f
 
bool _isHostMMFeedbacksNotNull
 
MMChannelData _channelData
 

Properties

override float FeedbackDuration [get]
 sets the inspector color for this feedback More...
 
- Properties inherited from MoreMountains.Feedbacks.MMFeedback
GameObject Owner [get, set]
 the Owner of the feedback, as defined when calling the Initialization method More...
 
virtual IEnumerator Pause [get]
 set this to true if your feedback should pause the execution of the feedback sequence More...
 
virtual bool HoldingPause [get]
 if this is true, this feedback will wait until all previous feedbacks have run More...
 
virtual bool LooperPause [get]
 if this is true, this feedback will wait until all previous feedbacks have run, then run all previous feedbacks again More...
 
virtual bool ScriptDrivenPause [get, set]
 if this is true, this feedback will pause and wait until Resume() is called on its parent MMFeedbacks to resume execution More...
 
virtual float ScriptDrivenPauseAutoResume [get, set]
 if this is a positive value, the feedback will auto resume after that duration if it hasn't been resumed via script already More...
 
virtual bool LooperStart [get]
 if this is true, this feedback will wait until all previous feedbacks have run, then run all previous feedbacks again More...
 
virtual bool InCooldown [get]
 returns true if this feedback is in cooldown at this time (and thus can't play), false otherwise More...
 
virtual bool IsPlaying [get, set]
 if this is true, this feedback is currently playing More...
 
float FeedbackTime [get]
 the time (or unscaled time) based on the selected Timing settings More...
 
float FeedbackDeltaTime [get]
 the delta time (or unscaled delta time) based on the selected Timing settings More...
 
float TotalDuration [get]
 The total duration of this feedback : total = initial delay + duration * (number of repeats + delay between repeats)
More...
 
virtual float FeedbackStartedAt [get]
 
virtual float FeedbackDuration [get, set]
 
virtual bool FeedbackPlaying [get]
 whether or not this feedback is playing right now More...
 
virtual bool NormalPlayDirection [get]
 Returns true if this feedback should play normally, or false if it should play in rewind More...
 
virtual bool ShouldPlayInThisSequenceDirection [get]
 Returns true if this feedback should play in the current parent MMFeedbacks direction, according to its MMFeedbacksDirectionCondition setting More...
 
virtual float? FinalNormalizedTime [get]
 Returns the t value at which to evaluate a curve at the end of this feedback's play time More...
 

Additional Inherited Members

- Public Member Functions inherited from MoreMountains.Feedbacks.MMFeedback
virtual MMChannelData ChannelData (int channel)
 
virtual void Initialization (GameObject owner)
 Initializes the feedback and its timing related variables More...
 
virtual void Play (Vector3 position, float feedbacksIntensity=1.0f)
 Plays the feedback More...
 
virtual void Stop (Vector3 position, float feedbacksIntensity=1.0f)
 Stops all feedbacks from playing. Will stop repeating feedbacks, and call custom stop implementations More...
 
virtual void ResetFeedback ()
 Calls this feedback's custom reset More...
 
virtual void SetSequence (MMSequence newSequence)
 Use this method to change this feedback's sequence at runtime More...
 
virtual void SetDelayBetweenRepeats (float delay)
 Use this method to specify a new delay between repeats at runtime More...
 
virtual void SetInitialDelay (float delay)
 Use this method to specify a new initial delay at runtime More...
 

Detailed Description

This feedback will let you play a sound via the MMSoundManager. You will need a game object in your scene with a MMSoundManager object on it for this to work.

Member Function Documentation

◆ CustomPlayFeedback()

override void MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.CustomPlayFeedback ( Vector3  position,
float  feedbacksIntensity = 1.0f 
)
protectedvirtual

Plays either a random sound or the specified sfx

Parameters
position
feedbacksIntensity

Implements MoreMountains.Feedbacks.MMFeedback.

◆ CustomStopFeedback()

override void MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.CustomStopFeedback ( Vector3  position,
float  feedbacksIntensity = 1 
)
protectedvirtual

On Stop, we stop our sound if needed

Parameters
position
feedbacksIntensity

Reimplemented from MoreMountains.Feedbacks.MMFeedback.

◆ GetDuration()

virtual float MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.GetDuration ( )
protectedvirtual

Returns the duration of the sound, or of the longest of the random sounds

Returns

◆ PlayAudioSource()

virtual void MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.PlayAudioSource ( AudioSource  audioSource,
AudioClip  sfx,
float  volume,
float  pitch,
int  timeSamples 
)
protectedvirtual

Plays the audio source with the specified volume and pitch

Parameters
audioSource
sfx
volume
pitch

◆ PlaySound()

virtual void MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.PlaySound ( AudioClip  sfx,
Vector3  position,
float  intensity 
)
protectedvirtual

Triggers a play sound event

Parameters
sfx
position
intensity

◆ TestPlaySound()

virtual async void MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.TestPlaySound ( )
protectedvirtual

A test method that creates an audiosource, plays it, and destroys itself after play

◆ TestStopSound()

virtual void MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.TestStopSound ( )
protectedvirtual

A test method that stops the test sound

Member Data Documentation

◆ _editorAudioSource

AudioSource MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound._editorAudioSource
protected

◆ _options

MMSoundManagerPlayOptions MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound._options
protected

◆ _playedAudioSource

AudioSource MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound._playedAudioSource
protected

◆ _randomClip

AudioClip MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound._randomClip
protected

◆ AudioGroup

AudioMixerGroup MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.AudioGroup = null

the AudioGroup on which to play the sound. If you're already targeting a preset track, you can leave it blank, otherwise the group you specify here will override it.

◆ AutoUnSoloOnEnd

bool MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.AutoUnSoloOnEnd = false

if in any of the above solo modes, AutoUnSoloOnEnd will unmute the track(s) automatically once that sound stops playing

◆ BypassEffects

bool MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.BypassEffects = false

Bypass effects (Applied from filter components or global listener filters).

◆ BypassListenerEffects

bool MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.BypassListenerEffects = false

When set global effects on the AudioListener will not be applied to the audio signal generated by the AudioSource. Does not apply if the AudioSource is playing into a mixer group.

◆ BypassReverbZones

bool MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.BypassReverbZones = false

When set doesn't route the signal from an AudioSource into the global reverb associated with reverb zones.

◆ DoNotAutoRecycleIfNotDonePlaying

bool MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.DoNotAutoRecycleIfNotDonePlaying = false

if this is true, this sound won't be recycled if it's not done playing

◆ DoNotPlayIfClipAlreadyPlaying

bool MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.DoNotPlayIfClipAlreadyPlaying = false

whether or not this sound should play if the same sound clip is already playing

◆ DopplerLevel

float MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.DopplerLevel = 1f

Sets the Doppler scale for this AudioSource.

◆ Fade

bool MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.Fade = false

whether or not to fade this sound in when playing it

◆ FadeDuration

float MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.FadeDuration = 1f

if fading, the duration of the fade, in seconds

◆ FadeInitialVolume

float MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.FadeInitialVolume = 0f

if fading, the volume at which to start the fade

◆ FadeTween

MMTweenType MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.FadeTween = new MMTweenType(MMTween.MMTweenCurve.EaseInOutQuartic)

if fading, the tween over which to fade the sound

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.FeedbackTypeAuthorized = true
static

a static bool used to disable all feedbacks of this type at once

◆ ID

int MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.ID = 0

the ID of the sound. This is useful if you plan on using sound control feedbacks on it afterwards.

◆ Loop

bool MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.Loop = false

whether or not this sound should loop

◆ MaxDistance

float MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.MaxDistance = 500f

(Logarithmic rolloff) MaxDistance is the distance a sound stops attenuating at.

◆ MaxPitch

float MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.MaxPitch = 1f

the maximum pitch to play the sound at

◆ MaxVolume

float MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.MaxVolume = 1f

the maximum volume to play the sound at

◆ MinDistance

float MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.MinDistance = 1f

Within the Min distance the AudioSource will cease to grow louder in volume.

◆ MinPitch

float MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.MinPitch = 1f

the minimum pitch to play the sound at

◆ MinVolume

float MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.MinVolume = 1f

the minimum volume to play the sound at

◆ MmSoundManagerTrack

MMSoundManager.MMSoundManagerTracks MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.MmSoundManagerTrack = MMSoundManager.MMSoundManagerTracks.Sfx

the track on which to play the sound. Pick the one that matches the nature of your sound

◆ PanStereo

float MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.PanStereo

Pans a playing sound in a stereo way (left or right). This only applies to sounds that are Mono or Stereo.

◆ Persistent

bool MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.Persistent = false

whether or not this sound should continue playing when transitioning to another scene

◆ Priority

int MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.Priority = 128

Sets the priority of the AudioSource.

◆ RandomSfx

AudioClip [] MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.RandomSfx

an array to pick a random sfx from

◆ RecycleAudioSource

AudioSource MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.RecycleAudioSource = null

if (for some reason) you've already got an audiosource and wouldn't like to use the built-in pool system, you can specify it here

◆ ReverbZoneMix

float MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.ReverbZoneMix = 1f

The amount by which the signal from the AudioSource will be mixed into the global reverb associated with the Reverb Zones.

◆ RolloffMode

AudioRolloffMode MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.RolloffMode = AudioRolloffMode.Logarithmic

Sets/Gets how the AudioSource attenuates over distance.

◆ Sfx

AudioClip MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.Sfx

the sound clip to play

◆ SoloAllTracks

bool MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.SoloAllTracks = false

whether or not this sound should play in solo mode over all other tracks. If yes, all other tracks will be muted when this sound starts playing

◆ SoloSingleTrack

bool MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.SoloSingleTrack = false

whether or not this sound should play in solo mode over its destination track. If yes, all other sounds on that track will be muted when this sound starts playing

◆ SpatialBlend

float MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.SpatialBlend

Sets how much this AudioSource is affected by 3D spatialisation calculations (attenuation, doppler etc). 0.0 makes the sound full 2D, 1.0 makes it full 3D.

◆ Spread

int MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.Spread = 0

Sets the spread angle (in degrees) of a 3d stereo or multichannel sound in speaker space.

◆ StopSoundOnFeedbackStop

bool MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.StopSoundOnFeedbackStop = false

if this is true, this sound will stop playing when stopping the feedback

◆ TestButton

bool MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.TestButton

◆ TestStopButton

bool MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.TestStopButton

Property Documentation

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMFeedbackMMSoundManagerSound.FeedbackDuration
get

sets the inspector color for this feedback

the duration of this feedback is the duration of the clip being played


The documentation for this class was generated from the following file: