TopDown Engine  v4.1
MoreMountains.Feedbacks.MMFeedbacks Class Reference

A collection of MMFeedback, meant to be played altogether. This class provides a custom inspector to add and customize feedbacks, and public methods to trigger them, stop them, etc. You can either use it on its own, or bind it from another class and trigger it from there. More...

Inheritance diagram for MoreMountains.Feedbacks.MMFeedbacks:
MoreMountains.Feedbacks.MMF_Player

Public Types

enum  Directions { Directions.TopToBottom, Directions.BottomToTop }
 the possible directions MMFeedbacks can be played More...
 
enum  SafeModes { SafeModes.Nope, SafeModes.EditorOnly, SafeModes.RuntimeOnly, SafeModes.Full }
 
enum  InitializationModes { InitializationModes.Script, InitializationModes.Awake, InitializationModes.Start }
 

Public Member Functions

virtual float GetTime ()
 
virtual float GetDeltaTime ()
 
virtual void Initialization (bool forceInitIfPlaying=false)
 Initializes the MMFeedbacks, setting this MMFeedbacks as the owner More...
 
virtual void Initialization (GameObject owner)
 A public method to initialize the feedback, specifying an owner that will be used as the reference for position and hierarchy by feedbacks More...
 
virtual void PlayFeedbacks ()
 Plays all feedbacks using the MMFeedbacks' position as reference, and no attenuation More...
 
virtual async System.Threading.Tasks.Task PlayFeedbacksTask (Vector3 position, float feedbacksIntensity=1.0f, bool forceRevert=false)
 Plays all feedbacks and awaits until completion More...
 
virtual async System.Threading.Tasks.Task PlayFeedbacksTask ()
 Plays all feedbacks and awaits until completion More...
 
virtual void PlayFeedbacks (Vector3 position, float feedbacksIntensity=1.0f, bool forceRevert=false)
 Plays all feedbacks, specifying a position and intensity. The position may be used by each Feedback and taken into account to spark a particle or play a sound for example. The feedbacks intensity is a factor that can be used by each Feedback to lower its intensity, usually you'll want to define that attenuation based on time or distance (using a lower intensity value for feedbacks happening further away from the Player). Additionally you can force the feedback to play in reverse, ignoring its current condition More...
 
virtual void PlayFeedbacksInReverse ()
 Plays all feedbacks using the MMFeedbacks' position as reference, and no attenuation, and in reverse (from bottom to top) More...
 
virtual void PlayFeedbacksInReverse (Vector3 position, float feedbacksIntensity=1.0f, bool forceRevert=false)
 Plays all feedbacks using the MMFeedbacks' position as reference, and no attenuation, and in reverse (from bottom to top) More...
 
virtual void PlayFeedbacksOnlyIfReversed ()
 Plays all feedbacks in the sequence, but only if this MMFeedbacks is playing in reverse order More...
 
virtual void PlayFeedbacksOnlyIfReversed (Vector3 position, float feedbacksIntensity=1.0f, bool forceRevert=false)
 Plays all feedbacks in the sequence, but only if this MMFeedbacks is playing in reverse order More...
 
virtual void PlayFeedbacksOnlyIfNormalDirection ()
 Plays all feedbacks in the sequence, but only if this MMFeedbacks is playing in normal order More...
 
virtual void PlayFeedbacksOnlyIfNormalDirection (Vector3 position, float feedbacksIntensity=1.0f, bool forceRevert=false)
 Plays all feedbacks in the sequence, but only if this MMFeedbacks is playing in normal order More...
 
virtual IEnumerator PlayFeedbacksCoroutine (Vector3 position, float feedbacksIntensity=1.0f, bool forceRevert=false)
 A public coroutine you can call externally when you want to yield in a coroutine of yours until the MMFeedbacks has stopped playing typically : yield return myFeedback.PlayFeedbacksCoroutine(this.transform.position, 1.0f, false); More...
 
virtual bool HasFeedbackStillPlaying ()
 Returns true if feedbacks are still playing More...
 
virtual void StopFeedbacks ()
 Stops all further feedbacks from playing, without stopping individual feedbacks More...
 
virtual void StopFeedbacks (bool stopAllFeedbacks=true)
 Stops all feedbacks from playing, with an option to also stop individual feedbacks More...
 
virtual void StopFeedbacks (Vector3 position, float feedbacksIntensity=1.0f, bool stopAllFeedbacks=true)
 Stops all feedbacks from playing, specifying a position and intensity that can be used by the Feedbacks More...
 
virtual void ResetFeedbacks ()
 Calls each feedback's Reset method if they've defined one. An example of that can be resetting the initial color of a flickering renderer. More...
 
virtual void Revert ()
 Changes the direction of this MMFeedbacks More...
 
virtual void SetCanPlay (bool newState)
 Use this method to authorize or prevent this player from being played More...
 
virtual void PauseFeedbacks ()
 Pauses execution of a sequence, which can then be resumed by calling ResumeFeedbacks() More...
 
virtual void ResumeFeedbacks ()
 Resumes execution of a sequence if a script driven pause is in progress More...
 
virtual MMFeedback AddFeedback (System.Type feedbackType, bool add=true)
 
virtual void RemoveFeedback (int id)
 
virtual float ApplyTimeMultiplier (float duration)
 Applies this feedback's time multiplier to a duration (in seconds) More...
 
virtual void AutoRepair ()
 Unity sometimes has serialization issues. This method fixes that by fixing any bad sync that could happen. More...
 

Public Attributes

List< MMFeedbackFeedbacks = new List<MMFeedback>()
 a list of MMFeedback to trigger More...
 
InitializationModes InitializationMode = InitializationModes.Start
 the chosen initialization mode More...
 
bool AutoInitialization = true
 if you set this to true, the system will make changes to ensure that initialization always happens before play More...
 
SafeModes SafeMode = SafeModes.Full
 the selected safe mode More...
 
Directions Direction = Directions.TopToBottom
 the selected direction More...
 
bool AutoChangeDirectionOnEnd = false
 whether or not this MMFeedbacks should invert its direction when all feedbacks have played More...
 
bool AutoPlayOnStart = false
 whether or not to play this feedbacks automatically on Start More...
 
bool AutoPlayOnEnable = false
 whether or not to play this feedbacks automatically on Enable More...
 
bool ForceTimescaleMode = false
 if this is true, all feedbacks within that player will work on the specified ForcedTimescaleMode, regardless of their individual settings More...
 
TimescaleModes ForcedTimescaleMode = TimescaleModes.Unscaled
 the time scale mode all feedbacks on this player should work on, if ForceTimescaleMode is true More...
 
float DurationMultiplier = 1f
 a time multiplier that will be applied to all feedback durations (initial delay, duration, delay between repeats...) More...
 
float TimescaleMultiplier = 1f
 a multiplier to apply to all timescale operations (1: normal, less than 1: slower operations, higher than 1: faster operations) More...
 
bool RandomizeDuration = false
 if this is true, will expose a RandomDurationMultiplier. The final duration of each feedback will be : their base duration * DurationMultiplier * a random value between RandomDurationMultiplier.x and RandomDurationMultiplier.y More...
 
Vector2 RandomDurationMultiplier = new Vector2(0.5f, 1.5f)
 if RandomizeDuration is true, the min (x) and max (y) values for the random duration multiplier More...
 
bool DisplayFullDurationDetails = false
 if this is true, more editor-only, detailed info will be displayed per feedback in the duration slot More...
 
TimescaleModes PlayerTimescaleMode = TimescaleModes.Unscaled
 the timescale at which the player itself will operate. This notably impacts sequencing and pauses duration evaluation. More...
 
bool OnlyPlayIfWithinRange = false
 if this is true, this feedback will only play if its distance to RangeCenter is lower or equal to RangeDistance More...
 
Transform RangeCenter
 when in OnlyPlayIfWithinRange mode, the transform to consider as the center of the range More...
 
float RangeDistance = 5f
 when in OnlyPlayIfWithinRange mode, the distance to the center within which the feedback will play More...
 
bool UseRangeFalloff = false
 when in OnlyPlayIfWithinRange mode, whether or not to modify the intensity of feedbacks based on the RangeFallOff curve
More...
 
AnimationCurve RangeFalloff = new AnimationCurve(new Keyframe(0f, 1f), new Keyframe(1f, 0f))
 the animation curve to use to define falloff (on the x 0 represents the range center, 1 represents the max distance to it) More...
 
Vector2 RemapRangeFalloff = new Vector2(0f, 1f)
 the values to remap the falloff curve's y axis' 0 and 1 More...
 
bool IgnoreRangeEvents = false
 whether or not to ignore MMSetFeedbackRangeCenterEvent, used to set the RangeCenter from anywhere More...
 
float CooldownDuration = 0f
 a duration, in seconds, during which triggering a new play of this MMFeedbacks after it's been played once will be impossible More...
 
float InitialDelay = 0f
 a duration, in seconds, to delay the start of this MMFeedbacks' contents play More...
 
bool CanPlay = true
 whether this player can be played or not, useful to temporarily prevent play from another class, for example More...
 
bool CanPlayWhileAlreadyPlaying = true
 if this is true, you'll be able to trigger a new Play while this feedback is already playing, otherwise you won't be able to More...
 
float ChanceToPlay = 100f
 the chance of this sequence happening (in percent : 100 : happens all the time, 0 : never happens, 50 : happens once every two calls, etc) More...
 
float FeedbacksIntensity = 1f
 
MMFeedbacksEvents Events
 a number of UnityEvents that can be triggered at the various stages of this MMFeedbacks More...
 
bool DebugActive = false
 whether or not this MMFeedbacks is in debug mode More...
 
virtual float ElapsedTime => IsPlaying ? GetTime() - _lastStartAt : 0f
 if this MMFeedbacks is playing the time since it started playing More...
 
virtual float ComputedInitialDelay => ApplyTimeMultiplier(InitialDelay)
 

Static Public Attributes

static bool GlobalMMFeedbacksActive = true
 a global switch used to turn all feedbacks on or off globally More...
 

Protected Member Functions

virtual void Awake ()
 On Awake we initialize our feedbacks if we're in auto mode More...
 
virtual void Start ()
 On Start we initialize our feedbacks if we're in auto mode More...
 
virtual void OnEnable ()
 On Enable we initialize our feedbacks if we're in auto mode More...
 
virtual void PlayFeedbacksInternal (Vector3 position, float feedbacksIntensity, bool forceRevert=false)
 An internal method used to play feedbacks, shouldn't be called externally More...
 
virtual void PreparePlay (Vector3 position, float feedbacksIntensity, bool forceRevert=false)
 
virtual void CheckForPauses ()
 
virtual void PlayAllFeedbacks (Vector3 position, float feedbacksIntensity, bool forceRevert=false)
 
virtual IEnumerator HandleInitialDelayCo (Vector3 position, float feedbacksIntensity, bool forceRevert=false)
 
virtual void Update ()
 
virtual IEnumerator PausedFeedbacksCo (Vector3 position, float feedbacksIntensity)
 A coroutine used to handle the sequence of feedbacks if pauses are involved More...
 
virtual bool EvaluateChance ()
 Evaluates the chance of this feedback to play, and returns true if this feedback can play, false otherwise More...
 
virtual void CheckForLoops ()
 Checks whether or not this MMFeedbacks contains one or more looper feedbacks More...
 
bool FeedbackCanPlay (MMFeedback feedback)
 This will return true if the conditions defined in the specified feedback's Timing section allow it to play in the current play direction of this MMFeedbacks More...
 
virtual void ApplyAutoRevert ()
 Readies the MMFeedbacks to revert direction on the next play More...
 
virtual void OnDisable ()
 On Disable we stop all feedbacks More...
 
virtual void OnValidate ()
 On validate, we make sure our DurationMultiplier remains positive More...
 
virtual void OnDestroy ()
 On Destroy, removes all feedbacks from this MMFeedbacks to avoid any leftovers More...
 

Protected Attributes

float _startTime = 0f
 
float _holdingMax = 0f
 
float _lastStartAt = -float.MaxValue
 
int _lastStartFrame = -1
 
bool _pauseFound = false
 
float _totalDuration = 0f
 
bool _shouldStop = false
 
float _randomDurationMultiplier = 1f
 
float _lastOnEnableFrame = -1
 

Static Protected Attributes

const float _smallValue = 0.001f
 

Properties

bool IsPlaying [get, protected set]
 
int TimesPlayed [get, protected set]
 the amount of times this MMFeedbacks has been played More...
 
bool InScriptDrivenPause [get, set]
 whether or not the execution of this MMFeedbacks' sequence is being prevented and waiting for a Resume() call More...
 
bool ContainsLoop [get, set]
 true if this MMFeedbacks contains at least one loop More...
 
bool ShouldRevertOnNextPlay [get, set]
 true if this feedback should change play direction next time it's played More...
 
bool ForcingUnscaledTimescaleMode [get]
 true if this player is forcing unscaled mode More...
 
virtual float TotalDuration [get]
 The total duration (in seconds) of all the active feedbacks in this MMFeedbacks. More...
 

Detailed Description

A collection of MMFeedback, meant to be played altogether. This class provides a custom inspector to add and customize feedbacks, and public methods to trigger them, stop them, etc. You can either use it on its own, or bind it from another class and trigger it from there.

Member Enumeration Documentation

◆ Directions

the possible directions MMFeedbacks can be played

Enumerator
TopToBottom 
BottomToTop 

◆ InitializationModes

the possible initialization modes. If you use Script, you'll have to initialize manually by calling the Initialization method and passing it an owner Otherwise, you can have this component initialize itself at Awake or Start, and in this case the owner will be the MMFeedbacks itself

Enumerator
Script 
Awake 
Start 

◆ SafeModes

the possible SafeModes (will perform checks to make sure no serialization error has damaged them)

  • nope : no safety
  • editor only : performs checks on enable
  • runtime only : performs checks on Awake
  • full : performs both editor and runtime checks, recommended setting
Enumerator
Nope 
EditorOnly 
RuntimeOnly 
Full 

Member Function Documentation

◆ AddFeedback()

virtual MMFeedback MoreMountains.Feedbacks.MMFeedbacks.AddFeedback ( System.Type  feedbackType,
bool  add = true 
)
virtual

◆ ApplyAutoRevert()

virtual void MoreMountains.Feedbacks.MMFeedbacks.ApplyAutoRevert ( )
protectedvirtual

Readies the MMFeedbacks to revert direction on the next play

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ ApplyTimeMultiplier()

virtual float MoreMountains.Feedbacks.MMFeedbacks.ApplyTimeMultiplier ( float  duration)
virtual

Applies this feedback's time multiplier to a duration (in seconds)

Parameters
duration
Returns

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ AutoRepair()

virtual void MoreMountains.Feedbacks.MMFeedbacks.AutoRepair ( )
virtual

Unity sometimes has serialization issues. This method fixes that by fixing any bad sync that could happen.

◆ Awake()

virtual void MoreMountains.Feedbacks.MMFeedbacks.Awake ( )
protectedvirtual

On Awake we initialize our feedbacks if we're in auto mode

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ CheckForLoops()

virtual void MoreMountains.Feedbacks.MMFeedbacks.CheckForLoops ( )
protectedvirtual

Checks whether or not this MMFeedbacks contains one or more looper feedbacks

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ CheckForPauses()

virtual void MoreMountains.Feedbacks.MMFeedbacks.CheckForPauses ( )
protectedvirtual

◆ EvaluateChance()

virtual bool MoreMountains.Feedbacks.MMFeedbacks.EvaluateChance ( )
protectedvirtual

Evaluates the chance of this feedback to play, and returns true if this feedback can play, false otherwise

Returns

◆ FeedbackCanPlay()

bool MoreMountains.Feedbacks.MMFeedbacks.FeedbackCanPlay ( MMFeedback  feedback)
protected

This will return true if the conditions defined in the specified feedback's Timing section allow it to play in the current play direction of this MMFeedbacks

Parameters
feedback
Returns

◆ GetDeltaTime()

virtual float MoreMountains.Feedbacks.MMFeedbacks.GetDeltaTime ( )
virtual

◆ GetTime()

virtual float MoreMountains.Feedbacks.MMFeedbacks.GetTime ( )
virtual

◆ HandleInitialDelayCo()

virtual IEnumerator MoreMountains.Feedbacks.MMFeedbacks.HandleInitialDelayCo ( Vector3  position,
float  feedbacksIntensity,
bool  forceRevert = false 
)
protectedvirtual

◆ HasFeedbackStillPlaying()

virtual bool MoreMountains.Feedbacks.MMFeedbacks.HasFeedbackStillPlaying ( )
virtual

Returns true if feedbacks are still playing

Returns

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ Initialization() [1/2]

virtual void MoreMountains.Feedbacks.MMFeedbacks.Initialization ( bool  forceInitIfPlaying = false)
virtual

Initializes the MMFeedbacks, setting this MMFeedbacks as the owner

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ Initialization() [2/2]

virtual void MoreMountains.Feedbacks.MMFeedbacks.Initialization ( GameObject  owner)
virtual

A public method to initialize the feedback, specifying an owner that will be used as the reference for position and hierarchy by feedbacks

Parameters
owner
feedbacksOwner

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ OnDestroy()

virtual void MoreMountains.Feedbacks.MMFeedbacks.OnDestroy ( )
protectedvirtual

On Destroy, removes all feedbacks from this MMFeedbacks to avoid any leftovers

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ OnDisable()

virtual void MoreMountains.Feedbacks.MMFeedbacks.OnDisable ( )
protectedvirtual

On Disable we stop all feedbacks

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ OnEnable()

virtual void MoreMountains.Feedbacks.MMFeedbacks.OnEnable ( )
protectedvirtual

On Enable we initialize our feedbacks if we're in auto mode

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ OnValidate()

virtual void MoreMountains.Feedbacks.MMFeedbacks.OnValidate ( )
protectedvirtual

On validate, we make sure our DurationMultiplier remains positive

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ PausedFeedbacksCo()

virtual IEnumerator MoreMountains.Feedbacks.MMFeedbacks.PausedFeedbacksCo ( Vector3  position,
float  feedbacksIntensity 
)
protectedvirtual

A coroutine used to handle the sequence of feedbacks if pauses are involved

Parameters
position
feedbacksIntensity
Returns

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ PauseFeedbacks()

virtual void MoreMountains.Feedbacks.MMFeedbacks.PauseFeedbacks ( )
virtual

Pauses execution of a sequence, which can then be resumed by calling ResumeFeedbacks()

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ PlayAllFeedbacks()

virtual void MoreMountains.Feedbacks.MMFeedbacks.PlayAllFeedbacks ( Vector3  position,
float  feedbacksIntensity,
bool  forceRevert = false 
)
protectedvirtual

◆ PlayFeedbacks() [1/2]

virtual void MoreMountains.Feedbacks.MMFeedbacks.PlayFeedbacks ( )
virtual

Plays all feedbacks using the MMFeedbacks' position as reference, and no attenuation

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ PlayFeedbacks() [2/2]

virtual void MoreMountains.Feedbacks.MMFeedbacks.PlayFeedbacks ( Vector3  position,
float  feedbacksIntensity = 1.0f,
bool  forceRevert = false 
)
virtual

Plays all feedbacks, specifying a position and intensity. The position may be used by each Feedback and taken into account to spark a particle or play a sound for example. The feedbacks intensity is a factor that can be used by each Feedback to lower its intensity, usually you'll want to define that attenuation based on time or distance (using a lower intensity value for feedbacks happening further away from the Player). Additionally you can force the feedback to play in reverse, ignoring its current condition

Parameters
position
feedbacksOwner
feedbacksIntensity

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ PlayFeedbacksCoroutine()

virtual IEnumerator MoreMountains.Feedbacks.MMFeedbacks.PlayFeedbacksCoroutine ( Vector3  position,
float  feedbacksIntensity = 1.0f,
bool  forceRevert = false 
)
virtual

A public coroutine you can call externally when you want to yield in a coroutine of yours until the MMFeedbacks has stopped playing typically : yield return myFeedback.PlayFeedbacksCoroutine(this.transform.position, 1.0f, false);

Parameters
positionThe position at which the MMFeedbacks should play
feedbacksIntensityThe intensity of the feedback
forceRevertWhether or not the MMFeedbacks should play in reverse or not
Returns

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ PlayFeedbacksInReverse() [1/2]

virtual void MoreMountains.Feedbacks.MMFeedbacks.PlayFeedbacksInReverse ( )
virtual

Plays all feedbacks using the MMFeedbacks' position as reference, and no attenuation, and in reverse (from bottom to top)

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ PlayFeedbacksInReverse() [2/2]

virtual void MoreMountains.Feedbacks.MMFeedbacks.PlayFeedbacksInReverse ( Vector3  position,
float  feedbacksIntensity = 1.0f,
bool  forceRevert = false 
)
virtual

Plays all feedbacks using the MMFeedbacks' position as reference, and no attenuation, and in reverse (from bottom to top)

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ PlayFeedbacksInternal()

virtual void MoreMountains.Feedbacks.MMFeedbacks.PlayFeedbacksInternal ( Vector3  position,
float  feedbacksIntensity,
bool  forceRevert = false 
)
protectedvirtual

An internal method used to play feedbacks, shouldn't be called externally

Parameters
position
feedbacksIntensity

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ PlayFeedbacksOnlyIfNormalDirection() [1/2]

virtual void MoreMountains.Feedbacks.MMFeedbacks.PlayFeedbacksOnlyIfNormalDirection ( )
virtual

Plays all feedbacks in the sequence, but only if this MMFeedbacks is playing in normal order

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ PlayFeedbacksOnlyIfNormalDirection() [2/2]

virtual void MoreMountains.Feedbacks.MMFeedbacks.PlayFeedbacksOnlyIfNormalDirection ( Vector3  position,
float  feedbacksIntensity = 1.0f,
bool  forceRevert = false 
)
virtual

Plays all feedbacks in the sequence, but only if this MMFeedbacks is playing in normal order

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ PlayFeedbacksOnlyIfReversed() [1/2]

virtual void MoreMountains.Feedbacks.MMFeedbacks.PlayFeedbacksOnlyIfReversed ( )
virtual

Plays all feedbacks in the sequence, but only if this MMFeedbacks is playing in reverse order

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ PlayFeedbacksOnlyIfReversed() [2/2]

virtual void MoreMountains.Feedbacks.MMFeedbacks.PlayFeedbacksOnlyIfReversed ( Vector3  position,
float  feedbacksIntensity = 1.0f,
bool  forceRevert = false 
)
virtual

Plays all feedbacks in the sequence, but only if this MMFeedbacks is playing in reverse order

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ PlayFeedbacksTask() [1/2]

virtual async System.Threading.Tasks.Task MoreMountains.Feedbacks.MMFeedbacks.PlayFeedbacksTask ( )
virtual

Plays all feedbacks and awaits until completion

◆ PlayFeedbacksTask() [2/2]

virtual async System.Threading.Tasks.Task MoreMountains.Feedbacks.MMFeedbacks.PlayFeedbacksTask ( Vector3  position,
float  feedbacksIntensity = 1.0f,
bool  forceRevert = false 
)
virtual

Plays all feedbacks and awaits until completion

Parameters
position
feedbacksIntensity
forceRevert

◆ PreparePlay()

virtual void MoreMountains.Feedbacks.MMFeedbacks.PreparePlay ( Vector3  position,
float  feedbacksIntensity,
bool  forceRevert = false 
)
protectedvirtual

◆ RemoveFeedback()

virtual void MoreMountains.Feedbacks.MMFeedbacks.RemoveFeedback ( int  id)
virtual

◆ ResetFeedbacks()

virtual void MoreMountains.Feedbacks.MMFeedbacks.ResetFeedbacks ( )
virtual

Calls each feedback's Reset method if they've defined one. An example of that can be resetting the initial color of a flickering renderer.

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ ResumeFeedbacks()

virtual void MoreMountains.Feedbacks.MMFeedbacks.ResumeFeedbacks ( )
virtual

Resumes execution of a sequence if a script driven pause is in progress

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ Revert()

virtual void MoreMountains.Feedbacks.MMFeedbacks.Revert ( )
virtual

Changes the direction of this MMFeedbacks

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ SetCanPlay()

virtual void MoreMountains.Feedbacks.MMFeedbacks.SetCanPlay ( bool  newState)
virtual

Use this method to authorize or prevent this player from being played

Parameters
newState

◆ Start()

virtual void MoreMountains.Feedbacks.MMFeedbacks.Start ( )
protectedvirtual

On Start we initialize our feedbacks if we're in auto mode

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ StopFeedbacks() [1/3]

virtual void MoreMountains.Feedbacks.MMFeedbacks.StopFeedbacks ( )
virtual

Stops all further feedbacks from playing, without stopping individual feedbacks

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ StopFeedbacks() [2/3]

virtual void MoreMountains.Feedbacks.MMFeedbacks.StopFeedbacks ( bool  stopAllFeedbacks = true)
virtual

Stops all feedbacks from playing, with an option to also stop individual feedbacks

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ StopFeedbacks() [3/3]

virtual void MoreMountains.Feedbacks.MMFeedbacks.StopFeedbacks ( Vector3  position,
float  feedbacksIntensity = 1.0f,
bool  stopAllFeedbacks = true 
)
virtual

Stops all feedbacks from playing, specifying a position and intensity that can be used by the Feedbacks

Parameters
position
feedbacksIntensity

Reimplemented in MoreMountains.Feedbacks.MMF_Player.

◆ Update()

virtual void MoreMountains.Feedbacks.MMFeedbacks.Update ( )
protectedvirtual

Member Data Documentation

◆ _holdingMax

float MoreMountains.Feedbacks.MMFeedbacks._holdingMax = 0f
protected

◆ _lastOnEnableFrame

float MoreMountains.Feedbacks.MMFeedbacks._lastOnEnableFrame = -1
protected

◆ _lastStartAt

float MoreMountains.Feedbacks.MMFeedbacks._lastStartAt = -float.MaxValue
protected

◆ _lastStartFrame

int MoreMountains.Feedbacks.MMFeedbacks._lastStartFrame = -1
protected

◆ _pauseFound

bool MoreMountains.Feedbacks.MMFeedbacks._pauseFound = false
protected

◆ _randomDurationMultiplier

float MoreMountains.Feedbacks.MMFeedbacks._randomDurationMultiplier = 1f
protected

◆ _shouldStop

bool MoreMountains.Feedbacks.MMFeedbacks._shouldStop = false
protected

◆ _smallValue

const float MoreMountains.Feedbacks.MMFeedbacks._smallValue = 0.001f
staticprotected

◆ _startTime

float MoreMountains.Feedbacks.MMFeedbacks._startTime = 0f
protected

◆ _totalDuration

float MoreMountains.Feedbacks.MMFeedbacks._totalDuration = 0f
protected

◆ AutoChangeDirectionOnEnd

bool MoreMountains.Feedbacks.MMFeedbacks.AutoChangeDirectionOnEnd = false

whether or not this MMFeedbacks should invert its direction when all feedbacks have played

◆ AutoInitialization

bool MoreMountains.Feedbacks.MMFeedbacks.AutoInitialization = true

if you set this to true, the system will make changes to ensure that initialization always happens before play

◆ AutoPlayOnEnable

bool MoreMountains.Feedbacks.MMFeedbacks.AutoPlayOnEnable = false

whether or not to play this feedbacks automatically on Enable

◆ AutoPlayOnStart

bool MoreMountains.Feedbacks.MMFeedbacks.AutoPlayOnStart = false

whether or not to play this feedbacks automatically on Start

◆ CanPlay

bool MoreMountains.Feedbacks.MMFeedbacks.CanPlay = true

whether this player can be played or not, useful to temporarily prevent play from another class, for example

◆ CanPlayWhileAlreadyPlaying

bool MoreMountains.Feedbacks.MMFeedbacks.CanPlayWhileAlreadyPlaying = true

if this is true, you'll be able to trigger a new Play while this feedback is already playing, otherwise you won't be able to

◆ ChanceToPlay

float MoreMountains.Feedbacks.MMFeedbacks.ChanceToPlay = 100f

the chance of this sequence happening (in percent : 100 : happens all the time, 0 : never happens, 50 : happens once every two calls, etc)

◆ ComputedInitialDelay

virtual float MoreMountains.Feedbacks.MMFeedbacks.ComputedInitialDelay => ApplyTimeMultiplier(InitialDelay)

◆ CooldownDuration

float MoreMountains.Feedbacks.MMFeedbacks.CooldownDuration = 0f

a duration, in seconds, during which triggering a new play of this MMFeedbacks after it's been played once will be impossible

◆ DebugActive

bool MoreMountains.Feedbacks.MMFeedbacks.DebugActive = false

whether or not this MMFeedbacks is in debug mode

◆ Direction

Directions MoreMountains.Feedbacks.MMFeedbacks.Direction = Directions.TopToBottom

the selected direction

◆ DisplayFullDurationDetails

bool MoreMountains.Feedbacks.MMFeedbacks.DisplayFullDurationDetails = false

if this is true, more editor-only, detailed info will be displayed per feedback in the duration slot

◆ DurationMultiplier

float MoreMountains.Feedbacks.MMFeedbacks.DurationMultiplier = 1f

a time multiplier that will be applied to all feedback durations (initial delay, duration, delay between repeats...)

◆ ElapsedTime

virtual float MoreMountains.Feedbacks.MMFeedbacks.ElapsedTime => IsPlaying ? GetTime() - _lastStartAt : 0f

if this MMFeedbacks is playing the time since it started playing

◆ Events

MMFeedbacksEvents MoreMountains.Feedbacks.MMFeedbacks.Events

a number of UnityEvents that can be triggered at the various stages of this MMFeedbacks

◆ Feedbacks

List<MMFeedback> MoreMountains.Feedbacks.MMFeedbacks.Feedbacks = new List<MMFeedback>()

a list of MMFeedback to trigger

◆ FeedbacksIntensity

float MoreMountains.Feedbacks.MMFeedbacks.FeedbacksIntensity = 1f

the intensity at which to play this feedback. That value will be used by most feedbacks to tune their amplitude. 1 is normal, 0.5 is half power, 0 is no effect. Note that what this value controls depends from feedback to feedback, don't hesitate to check the code to see what it does exactly.

◆ ForcedTimescaleMode

TimescaleModes MoreMountains.Feedbacks.MMFeedbacks.ForcedTimescaleMode = TimescaleModes.Unscaled

the time scale mode all feedbacks on this player should work on, if ForceTimescaleMode is true

◆ ForceTimescaleMode

bool MoreMountains.Feedbacks.MMFeedbacks.ForceTimescaleMode = false

if this is true, all feedbacks within that player will work on the specified ForcedTimescaleMode, regardless of their individual settings

◆ GlobalMMFeedbacksActive

bool MoreMountains.Feedbacks.MMFeedbacks.GlobalMMFeedbacksActive = true
static

a global switch used to turn all feedbacks on or off globally

◆ IgnoreRangeEvents

bool MoreMountains.Feedbacks.MMFeedbacks.IgnoreRangeEvents = false

whether or not to ignore MMSetFeedbackRangeCenterEvent, used to set the RangeCenter from anywhere

◆ InitialDelay

float MoreMountains.Feedbacks.MMFeedbacks.InitialDelay = 0f

a duration, in seconds, to delay the start of this MMFeedbacks' contents play

◆ InitializationMode

InitializationModes MoreMountains.Feedbacks.MMFeedbacks.InitializationMode = InitializationModes.Start

the chosen initialization mode

◆ OnlyPlayIfWithinRange

bool MoreMountains.Feedbacks.MMFeedbacks.OnlyPlayIfWithinRange = false

if this is true, this feedback will only play if its distance to RangeCenter is lower or equal to RangeDistance

◆ PlayerTimescaleMode

TimescaleModes MoreMountains.Feedbacks.MMFeedbacks.PlayerTimescaleMode = TimescaleModes.Unscaled

the timescale at which the player itself will operate. This notably impacts sequencing and pauses duration evaluation.

◆ RandomDurationMultiplier

Vector2 MoreMountains.Feedbacks.MMFeedbacks.RandomDurationMultiplier = new Vector2(0.5f, 1.5f)

if RandomizeDuration is true, the min (x) and max (y) values for the random duration multiplier

◆ RandomizeDuration

bool MoreMountains.Feedbacks.MMFeedbacks.RandomizeDuration = false

if this is true, will expose a RandomDurationMultiplier. The final duration of each feedback will be : their base duration * DurationMultiplier * a random value between RandomDurationMultiplier.x and RandomDurationMultiplier.y

◆ RangeCenter

Transform MoreMountains.Feedbacks.MMFeedbacks.RangeCenter

when in OnlyPlayIfWithinRange mode, the transform to consider as the center of the range

◆ RangeDistance

float MoreMountains.Feedbacks.MMFeedbacks.RangeDistance = 5f

when in OnlyPlayIfWithinRange mode, the distance to the center within which the feedback will play

◆ RangeFalloff

AnimationCurve MoreMountains.Feedbacks.MMFeedbacks.RangeFalloff = new AnimationCurve(new Keyframe(0f, 1f), new Keyframe(1f, 0f))

the animation curve to use to define falloff (on the x 0 represents the range center, 1 represents the max distance to it)

◆ RemapRangeFalloff

Vector2 MoreMountains.Feedbacks.MMFeedbacks.RemapRangeFalloff = new Vector2(0f, 1f)

the values to remap the falloff curve's y axis' 0 and 1

◆ SafeMode

SafeModes MoreMountains.Feedbacks.MMFeedbacks.SafeMode = SafeModes.Full

the selected safe mode

◆ TimescaleMultiplier

float MoreMountains.Feedbacks.MMFeedbacks.TimescaleMultiplier = 1f

a multiplier to apply to all timescale operations (1: normal, less than 1: slower operations, higher than 1: faster operations)

◆ UseRangeFalloff

bool MoreMountains.Feedbacks.MMFeedbacks.UseRangeFalloff = false

when in OnlyPlayIfWithinRange mode, whether or not to modify the intensity of feedbacks based on the RangeFallOff curve

Property Documentation

◆ ContainsLoop

bool MoreMountains.Feedbacks.MMFeedbacks.ContainsLoop
getset

true if this MMFeedbacks contains at least one loop

◆ ForcingUnscaledTimescaleMode

bool MoreMountains.Feedbacks.MMFeedbacks.ForcingUnscaledTimescaleMode
get

true if this player is forcing unscaled mode

◆ InScriptDrivenPause

bool MoreMountains.Feedbacks.MMFeedbacks.InScriptDrivenPause
getset

whether or not the execution of this MMFeedbacks' sequence is being prevented and waiting for a Resume() call

◆ IsPlaying

bool MoreMountains.Feedbacks.MMFeedbacks.IsPlaying
getprotected set

whether or not this MMFeedbacks is playing right now - meaning it hasn't been stopped yet. if you don't stop your MMFeedbacks it'll remain true of course

◆ ShouldRevertOnNextPlay

bool MoreMountains.Feedbacks.MMFeedbacks.ShouldRevertOnNextPlay
getset

true if this feedback should change play direction next time it's played

◆ TimesPlayed

int MoreMountains.Feedbacks.MMFeedbacks.TimesPlayed
getprotected set

the amount of times this MMFeedbacks has been played

◆ TotalDuration

virtual float MoreMountains.Feedbacks.MMFeedbacks.TotalDuration
get

The total duration (in seconds) of all the active feedbacks in this MMFeedbacks.


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