Feel  5.1
The best way to improve your game's feel and make it extra juicy
MoreMountains.Feedbacks.MMF_Player Class Reference
Inheritance diagram for MoreMountains.Feedbacks.MMF_Player:
MoreMountains.Feedbacks.MMFeedbacks

Public Types

enum  AccessMethods {
  AccessMethods.First, AccessMethods.Previous, AccessMethods.Closest, AccessMethods.Next,
  AccessMethods.Last
}
 
- Public Types inherited from MoreMountains.Feedbacks.MMFeedbacks
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, InitializationModes.OnEnable }
 

Public Member Functions

virtual IEnumerator PlayFeedbacksAfterFrames (int framesAmount)
 A coroutine you can start to play this player's feedbacks after X frames More...
 
virtual void PreInitialization ()
 
override void Initialization (bool forceInitIfPlaying=false)
 A public method to initialize the feedback, specifying an owner that will be used as the reference for position and hierarchy by feedbacks More...
 
override void Initialization (GameObject owner)
 When calling the legacy init method that used to specify an owner, we force the MMF Player init to run More...
 
override void PlayFeedbacks ()
 Plays all feedbacks using the MMFeedbacks' position as reference, and no attenuation More...
 
override void PlayFeedbacks (Vector3 position, float feedbacksIntensity=1.0f, bool forceChangeDirection=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...
 
override void PlayFeedbacksInReverse ()
 Plays all feedbacks using the MMFeedbacks' position as reference, and no attenuation, and in reverse (from bottom to top) More...
 
override void PlayFeedbacksInReverse (Vector3 position, float feedbacksIntensity=1.0f, bool forceChangeDirection=false)
 Plays all feedbacks using the MMFeedbacks' position as reference, and no attenuation, and in reverse (from bottom to top) More...
 
override void PlayFeedbacksOnlyIfReversed ()
 Plays all feedbacks in the sequence, but only if this MMFeedbacks is playing in reverse order More...
 
override void PlayFeedbacksOnlyIfReversed (Vector3 position, float feedbacksIntensity=1.0f, bool forceChangeDirection=false)
 Plays all feedbacks in the sequence, but only if this MMFeedbacks is playing in reverse order More...
 
override void PlayFeedbacksOnlyIfNormalDirection ()
 Plays all feedbacks in the sequence, but only if this MMFeedbacks is playing in normal order More...
 
override void PlayFeedbacksOnlyIfNormalDirection (Vector3 position, float feedbacksIntensity=1.0f, bool forceChangeDirection=false)
 Plays all feedbacks in the sequence, but only if this MMFeedbacks is playing in normal order More...
 
override IEnumerator PlayFeedbacksCoroutine (Vector3 position, float feedbacksIntensity=1.0f, bool forceChangeDirection=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 IsAllowedToPlay (Vector3 position)
 Returns true if this feedback is allowed to play, false otherwise More...
 
override void StopFeedbacks ()
 Stops all further feedbacks from playing, as well as stopping individual feedbacks More...
 
override void StopFeedbacks (bool stopAllFeedbacks=true)
 Stops all feedbacks from playing, with an option to also stop individual feedbacks More...
 
override 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...
 
override 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. It's usually called automatically before playing them. More...
 
override void ChangeDirection ()
 Changes the direction of this MMFeedbacks More...
 
virtual void SetDirection (Directions newDirection)
 Sets the direction of the player to the one specified in parameters More...
 
void SetDirectionTopToBottom ()
 Sets the direction to top to bottom More...
 
void SetDirectionBottomToTop ()
 Sets the direction to bottom to top More...
 
virtual void PlayerCompleteFeedbacks ()
 When the player is done playing, we call PlayerComplete on all its feedbacks to let them know the player is done More...
 
override void PauseFeedbacks ()
 Pauses execution of a sequence, which can then be resumed by calling ResumeFeedbacks() More...
 
virtual void RestoreInitialValues ()
 Restores the initial state of this player, resetting its feedbacks target values to their initial values More...
 
virtual void ForceInitialValues ()
 Forces initial vales on all feedbacks that support it. For example, a position feedback that'd move a Transform from A to B would move that transform to A More...
 
virtual void SkipToTheEnd ()
 Skips to the end of a sequence of feedbacks. Note that depending on your setup, this can take up to 3 frames to complete, don't disable your player instantly, or it won't complete the skipping More...
 
override void ResumeFeedbacks ()
 Resumes execution of a sequence if a script driven pause is in progress More...
 
virtual void ResetAllCooldowns ()
 Resets the cooldowns on this MMF Player, for the MMF Player itself and for all its feedbacks More...
 
virtual void ResetCooldown ()
 Resets the cooldown on this MMF Player, letting you play it again instantly, regardless of its cooldown settings and how much time has passed since its last play More...
 
virtual void ResetFeedbacksCooldowns ()
 Resets cooldowns on all feedbacks, letting you play them again instantly, regardless of their cooldown settings and how much time has passed since their last play More...
 
virtual void AddFeedback (MMF_Feedback newFeedback)
 Adds the specified MMF_Feedback to the player More...
 
new MMF_Feedback AddFeedback (System.Type feedbackType, bool add=true)
 Adds a feedback of the specified type to the player More...
 
override void RemoveFeedback (int id)
 Removes the feedback at the specified index More...
 
virtual void CopyPlayerFrom (MMF_Player source)
 Replaces the current feedback list and player settings with the ones on the target MMF Player More...
 
virtual void CopyFeedbackListFrom (MMF_Player source)
 Replaces the current feedback list with the feedbacks on the target MMF Player More...
 
virtual void AddFeedbackListFrom (MMF_Player source)
 Adds the feedbacks on the target MMF Player to the current feedback list More...
 
virtual void AutomaticShakerSetup ()
 Calls the AutomaticShakerSetup method on all feedbacks that have it More...
 
override bool HasFeedbackStillPlaying ()
 Returns true if feedbacks are still playing More...
 
virtual float ComputeRangeIntensityMultiplier (Vector3 position)
 Determines the intensity multiplier to apply More...
 
override float ApplyTimeMultiplier (float duration)
 Applies this feedback's time multiplier to a duration (in seconds) More...
 
virtual void ProxyDestroy (GameObject gameObjectToDestroy)
 Lets you destroy objects from feedbacks More...
 
virtual void ProxyDestroy (GameObject gameObjectToDestroy, float delay)
 Lets you destroy objects after a delay from feedbacks More...
 
virtual void ProxyDestroyImmediate (GameObject gameObjectToDestroy)
 Lets you DestroyImmediate objects from feedbacks More...
 
virtual T GetFeedbackOfType< T > (AccessMethods method, int referenceIndex)
 Returns the first feedback found in this player's list based on the chosen method and type First : first feedback of the matching type in the list, from top to bottom Previous : first feedback of the matching type located before (so above) the feedback at the reference index Closest : first feedback of the matching type located before or after the feedback at the reference index Next : first feedback of the matching type located after (so below) the feedback at the reference index First : last feedback of the matching type in the list, from top to bottom More...
 
virtual T GetFeedbackOfType< T > ()
 Returns the first feedback of the searched type on this MMF_Player More...
 
virtual List< T > GetFeedbacksOfType< T > ()
 Returns a list of all the feedbacks of the searched type on this MMF_Player More...
 
virtual T GetFeedbackOfType< T > (string searchedLabel)
 Returns the first feedback of the searched type on this MMF_Player More...
 
virtual List< T > GetFeedbacksOfType< T > (string searchedLabel)
 Returns a list of all the feedbacks of the searched type on this MMF_Player More...
 
virtual void RefreshCache ()
 Refreshes cached feedbacks More...
 
virtual void ComputeCachedTotalDuration ()
 Computes the total duration of the player's sequence of feedbacks More...
 
- Public Member Functions inherited from MoreMountains.Feedbacks.MMFeedbacks
virtual float GetTime ()
 
virtual float GetDeltaTime ()
 
virtual async System.Threading.Tasks.Task PlayFeedbacksTask (Vector3 position, float feedbacksIntensity=1.0f, bool forceChangeDirection=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 SetCanPlay (bool newState)
 Use this method to authorize or prevent this player from being played 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< MMF_FeedbackFeedbacksList
 
bool KeepPlayModeChanges = false
 
bool PerformanceMode = false
 if this is true, the inspector won't refresh while the feedback plays, this saves on performance but feedback inspectors' progress bars for example won't look as smooth More...
 
bool StopFeedbacksOnDisable = false
 if this is true, StopFeedbacks will be called on all feedbacks on Disable More...
 
int PlayCount = 0
 how many times this player has started playing More...
 
- Public Attributes inherited from MoreMountains.Feedbacks.MMFeedbacks
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...
 
bool InScriptDrivenPause
 whether or not the execution of this MMFeedbacks' sequence is being prevented and waiting for a Resume() call More...
 
virtual float ComputedInitialDelay => ApplyTimeMultiplier(InitialDelay)
 

Protected Member Functions

override void Awake ()
 On Awake we initialize our feedbacks if we're in auto mode More...
 
override void Start ()
 On Start we initialize our feedbacks if we're in auto mode More...
 
virtual void InitializeFeedbackList ()
 We initialize our list of feedbacks More...
 
virtual void ExtraInitializationChecks ()
 Performs extra checks, mostly to cover cases of dynamic creation More...
 
override void OnEnable ()
 On Enable we initialize our feedbacks if we're in auto mode More...
 
override void PlayFeedbacksInternal (Vector3 position, float feedbacksIntensity, bool forceChangeDirection=false)
 An internal method used to play feedbacks, shouldn't be called externally More...
 
virtual IEnumerator FrameOnePlayCo (Vector3 position, float feedbacksIntensity, bool forceChangeDirection=false)
 
override void PreparePlay (Vector3 position, float feedbacksIntensity, bool forceChangeDirection=false)
 
override void CheckForPauses ()
 
override void PlayAllFeedbacks (Vector3 position, float feedbacksIntensity, bool forceChangeDirection=false)
 
override IEnumerator HandleInitialDelayCo (Vector3 position, float feedbacksIntensity, bool forceChangeDirection=false)
 
override void Update ()
 
override IEnumerator PausedFeedbacksCo (Vector3 position, float feedbacksIntensity)
 A coroutine used to handle the sequence of feedbacks if pauses are involved More...
 
virtual IEnumerator SkipToTheEndCo ()
 
override void CheckForLoops ()
 Checks whether or not this MMFeedbacks contains one or more looper feedbacks More...
 
virtual void ComputeNewRandomDurationMultipliers ()
 Computes new random duration multipliers on all feedbacks if needed More...
 
bool FeedbackCanPlay (MMF_Feedback 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...
 
override void ApplyAutoChangeDirection ()
 Readies the MMFeedbacks to change direction on the next play More...
 
virtual void OnMMSetFeedbackRangeCenterEvent (Transform newTransform)
 When we get a MMSetFeedbackRangeCenterEvent, we set our new range center More...
 
override void OnDisable ()
 On Disable we stop all feedbacks More...
 
override void OnValidate ()
 On validate, we make sure our DurationMultiplier remains positive More...
 
override void OnDestroy ()
 On Destroy, removes all feedbacks from this MMFeedbacks to avoid any leftovers More...
 
void OnDrawGizmosSelected ()
 Draws gizmos, when the MMF_Player is selected, for all feedbacks that implement the method of the same name More...
 
- Protected Member Functions inherited from MoreMountains.Feedbacks.MMFeedbacks
virtual bool EvaluateChance ()
 Evaluates the chance of this feedback to play, and returns true if this feedback can play, false otherwise 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...
 

Protected Attributes

Type _t
 
float _cachedTotalDuration
 
bool _initialized = false
 
- Protected Attributes inherited from MoreMountains.Feedbacks.MMFeedbacks
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
 

Properties

override float TotalDuration [get]
 
virtual bool SkippingToTheEnd [get, protected set]
 
virtual bool HasAutomaticShakerSetup [get]
 Returns true if one or more of the feedbacks on this MMF Player have an option for automatic shaker setup, false otherwise More...
 
- Properties inherited from MoreMountains.Feedbacks.MMFeedbacks
bool IsPlaying [get, protected set]
 
int TimesPlayed [get, protected set]
 the amount of times this MMFeedbacks has been played More...
 
bool ContainsLoop [get, set]
 true if this MMFeedbacks contains at least one loop More...
 
bool ShouldChangeDirectionOnNextPlay [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...
 

Additional Inherited Members

- Static Public Attributes inherited from MoreMountains.Feedbacks.MMFeedbacks
static bool GlobalMMFeedbacksActive = true
 a global switch used to turn all feedbacks on or off globally More...
 
- Static Protected Attributes inherited from MoreMountains.Feedbacks.MMFeedbacks
const float _smallValue = 0.001f
 

Member Enumeration Documentation

◆ AccessMethods

Enumerator
First 
Previous 
Closest 
Next 
Last 

Member Function Documentation

◆ AddFeedback() [1/2]

virtual void MoreMountains.Feedbacks.MMF_Player.AddFeedback ( MMF_Feedback  newFeedback)
virtual

Adds the specified MMF_Feedback to the player

Parameters
newFeedback

◆ AddFeedback() [2/2]

new MMF_Feedback MoreMountains.Feedbacks.MMF_Player.AddFeedback ( System.Type  feedbackType,
bool  add = true 
)
virtual

Adds a feedback of the specified type to the player

Parameters
feedbackType
Returns

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ AddFeedbackListFrom()

virtual void MoreMountains.Feedbacks.MMF_Player.AddFeedbackListFrom ( MMF_Player  source)
virtual

Adds the feedbacks on the target MMF Player to the current feedback list

Parameters
source

◆ ApplyAutoChangeDirection()

override void MoreMountains.Feedbacks.MMF_Player.ApplyAutoChangeDirection ( )
protectedvirtual

Readies the MMFeedbacks to change direction on the next play

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ ApplyTimeMultiplier()

override float MoreMountains.Feedbacks.MMF_Player.ApplyTimeMultiplier ( float  duration)
virtual

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

Parameters
duration
Returns

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ AutomaticShakerSetup()

virtual void MoreMountains.Feedbacks.MMF_Player.AutomaticShakerSetup ( )
virtual

Calls the AutomaticShakerSetup method on all feedbacks that have it

◆ Awake()

override void MoreMountains.Feedbacks.MMF_Player.Awake ( )
protectedvirtual

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

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ ChangeDirection()

override void MoreMountains.Feedbacks.MMF_Player.ChangeDirection ( )
virtual

Changes the direction of this MMFeedbacks

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ CheckForLoops()

override void MoreMountains.Feedbacks.MMF_Player.CheckForLoops ( )
protectedvirtual

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

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ CheckForPauses()

override void MoreMountains.Feedbacks.MMF_Player.CheckForPauses ( )
protectedvirtual

◆ ComputeCachedTotalDuration()

virtual void MoreMountains.Feedbacks.MMF_Player.ComputeCachedTotalDuration ( )
virtual

Computes the total duration of the player's sequence of feedbacks

◆ ComputeNewRandomDurationMultipliers()

virtual void MoreMountains.Feedbacks.MMF_Player.ComputeNewRandomDurationMultipliers ( )
protectedvirtual

Computes new random duration multipliers on all feedbacks if needed

◆ ComputeRangeIntensityMultiplier()

virtual float MoreMountains.Feedbacks.MMF_Player.ComputeRangeIntensityMultiplier ( Vector3  position)
virtual

Determines the intensity multiplier to apply

Parameters
position
Returns

◆ CopyFeedbackListFrom()

virtual void MoreMountains.Feedbacks.MMF_Player.CopyFeedbackListFrom ( MMF_Player  source)
virtual

Replaces the current feedback list with the feedbacks on the target MMF Player

Parameters
source

◆ CopyPlayerFrom()

virtual void MoreMountains.Feedbacks.MMF_Player.CopyPlayerFrom ( MMF_Player  source)
virtual

Replaces the current feedback list and player settings with the ones on the target MMF Player

Parameters
source

◆ ExtraInitializationChecks()

virtual void MoreMountains.Feedbacks.MMF_Player.ExtraInitializationChecks ( )
protectedvirtual

Performs extra checks, mostly to cover cases of dynamic creation

◆ FeedbackCanPlay()

bool MoreMountains.Feedbacks.MMF_Player.FeedbackCanPlay ( MMF_Feedback  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

◆ ForceInitialValues()

virtual void MoreMountains.Feedbacks.MMF_Player.ForceInitialValues ( )
virtual

Forces initial vales on all feedbacks that support it. For example, a position feedback that'd move a Transform from A to B would move that transform to A

◆ FrameOnePlayCo()

virtual IEnumerator MoreMountains.Feedbacks.MMF_Player.FrameOnePlayCo ( Vector3  position,
float  feedbacksIntensity,
bool  forceChangeDirection = false 
)
protectedvirtual

◆ GetFeedbackOfType< T >() [1/3]

virtual T MoreMountains.Feedbacks.MMF_Player.GetFeedbackOfType< T > ( )
virtual

Returns the first feedback of the searched type on this MMF_Player

Template Parameters
T
Returns
Type Constraints
T :MMF_Feedback 

◆ GetFeedbackOfType< T >() [2/3]

virtual T MoreMountains.Feedbacks.MMF_Player.GetFeedbackOfType< T > ( AccessMethods  method,
int  referenceIndex 
)
virtual

Returns the first feedback found in this player's list based on the chosen method and type First : first feedback of the matching type in the list, from top to bottom Previous : first feedback of the matching type located before (so above) the feedback at the reference index Closest : first feedback of the matching type located before or after the feedback at the reference index Next : first feedback of the matching type located after (so below) the feedback at the reference index First : last feedback of the matching type in the list, from top to bottom

Parameters
method
referenceIndex
Template Parameters
T
Returns
Type Constraints
T :MMF_Feedback 

◆ GetFeedbackOfType< T >() [3/3]

virtual T MoreMountains.Feedbacks.MMF_Player.GetFeedbackOfType< T > ( string  searchedLabel)
virtual

Returns the first feedback of the searched type on this MMF_Player

Template Parameters
T
Returns
Type Constraints
T :MMF_Feedback 

◆ GetFeedbacksOfType< T >() [1/2]

virtual List<T> MoreMountains.Feedbacks.MMF_Player.GetFeedbacksOfType< T > ( )
virtual

Returns a list of all the feedbacks of the searched type on this MMF_Player

Template Parameters
T
Returns
Type Constraints
T :MMF_Feedback 

◆ GetFeedbacksOfType< T >() [2/2]

virtual List<T> MoreMountains.Feedbacks.MMF_Player.GetFeedbacksOfType< T > ( string  searchedLabel)
virtual

Returns a list of all the feedbacks of the searched type on this MMF_Player

Template Parameters
T
Returns
Type Constraints
T :MMF_Feedback 

◆ HandleInitialDelayCo()

override IEnumerator MoreMountains.Feedbacks.MMF_Player.HandleInitialDelayCo ( Vector3  position,
float  feedbacksIntensity,
bool  forceChangeDirection = false 
)
protectedvirtual

◆ HasFeedbackStillPlaying()

override bool MoreMountains.Feedbacks.MMF_Player.HasFeedbackStillPlaying ( )
virtual

Returns true if feedbacks are still playing

Returns

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ Initialization() [1/2]

override void MoreMountains.Feedbacks.MMF_Player.Initialization ( bool  forceInitIfPlaying = false)
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 from MoreMountains.Feedbacks.MMFeedbacks.

◆ Initialization() [2/2]

override void MoreMountains.Feedbacks.MMF_Player.Initialization ( GameObject  owner)
virtual

When calling the legacy init method that used to specify an owner, we force the MMF Player init to run

Parameters
owner

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ InitializeFeedbackList()

virtual void MoreMountains.Feedbacks.MMF_Player.InitializeFeedbackList ( )
protectedvirtual

We initialize our list of feedbacks

◆ IsAllowedToPlay()

virtual bool MoreMountains.Feedbacks.MMF_Player.IsAllowedToPlay ( Vector3  position)
virtual

Returns true if this feedback is allowed to play, false otherwise

Parameters
position
Returns

◆ OnDestroy()

override void MoreMountains.Feedbacks.MMF_Player.OnDestroy ( )
protectedvirtual

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

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ OnDisable()

override void MoreMountains.Feedbacks.MMF_Player.OnDisable ( )
protectedvirtual

On Disable we stop all feedbacks

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ OnDrawGizmosSelected()

void MoreMountains.Feedbacks.MMF_Player.OnDrawGizmosSelected ( )
protected

Draws gizmos, when the MMF_Player is selected, for all feedbacks that implement the method of the same name

◆ OnEnable()

override void MoreMountains.Feedbacks.MMF_Player.OnEnable ( )
protectedvirtual

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

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ OnMMSetFeedbackRangeCenterEvent()

virtual void MoreMountains.Feedbacks.MMF_Player.OnMMSetFeedbackRangeCenterEvent ( Transform  newTransform)
protectedvirtual

When we get a MMSetFeedbackRangeCenterEvent, we set our new range center

Parameters
newTransform

◆ OnValidate()

override void MoreMountains.Feedbacks.MMF_Player.OnValidate ( )
protectedvirtual

On validate, we make sure our DurationMultiplier remains positive

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ PausedFeedbacksCo()

override IEnumerator MoreMountains.Feedbacks.MMF_Player.PausedFeedbacksCo ( Vector3  position,
float  feedbacksIntensity 
)
protectedvirtual

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

Parameters
position
feedbacksIntensity
Returns

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ PauseFeedbacks()

override void MoreMountains.Feedbacks.MMF_Player.PauseFeedbacks ( )
virtual

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

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ PlayAllFeedbacks()

override void MoreMountains.Feedbacks.MMF_Player.PlayAllFeedbacks ( Vector3  position,
float  feedbacksIntensity,
bool  forceChangeDirection = false 
)
protectedvirtual

◆ PlayerCompleteFeedbacks()

virtual void MoreMountains.Feedbacks.MMF_Player.PlayerCompleteFeedbacks ( )
virtual

When the player is done playing, we call PlayerComplete on all its feedbacks to let them know the player is done

◆ PlayFeedbacks() [1/2]

override void MoreMountains.Feedbacks.MMF_Player.PlayFeedbacks ( )
virtual

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

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ PlayFeedbacks() [2/2]

override void MoreMountains.Feedbacks.MMF_Player.PlayFeedbacks ( Vector3  position,
float  feedbacksIntensity = 1.0f,
bool  forceChangeDirection = 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 from MoreMountains.Feedbacks.MMFeedbacks.

◆ PlayFeedbacksAfterFrames()

virtual IEnumerator MoreMountains.Feedbacks.MMF_Player.PlayFeedbacksAfterFrames ( int  framesAmount)
virtual

A coroutine you can start to play this player's feedbacks after X frames

Parameters
framesAmount
Returns

◆ PlayFeedbacksCoroutine()

override IEnumerator MoreMountains.Feedbacks.MMF_Player.PlayFeedbacksCoroutine ( Vector3  position,
float  feedbacksIntensity = 1.0f,
bool  forceChangeDirection = 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
forceChangeDirectionWhether or not the MMFeedbacks should play in reverse or not
Returns

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ PlayFeedbacksInReverse() [1/2]

override void MoreMountains.Feedbacks.MMF_Player.PlayFeedbacksInReverse ( )
virtual

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

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ PlayFeedbacksInReverse() [2/2]

override void MoreMountains.Feedbacks.MMF_Player.PlayFeedbacksInReverse ( Vector3  position,
float  feedbacksIntensity = 1.0f,
bool  forceChangeDirection = false 
)
virtual

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

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ PlayFeedbacksInternal()

override void MoreMountains.Feedbacks.MMF_Player.PlayFeedbacksInternal ( Vector3  position,
float  feedbacksIntensity,
bool  forceChangeDirection = false 
)
protectedvirtual

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

Parameters
position
feedbacksIntensity

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ PlayFeedbacksOnlyIfNormalDirection() [1/2]

override void MoreMountains.Feedbacks.MMF_Player.PlayFeedbacksOnlyIfNormalDirection ( )
virtual

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

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ PlayFeedbacksOnlyIfNormalDirection() [2/2]

override void MoreMountains.Feedbacks.MMF_Player.PlayFeedbacksOnlyIfNormalDirection ( Vector3  position,
float  feedbacksIntensity = 1.0f,
bool  forceChangeDirection = false 
)
virtual

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

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ PlayFeedbacksOnlyIfReversed() [1/2]

override void MoreMountains.Feedbacks.MMF_Player.PlayFeedbacksOnlyIfReversed ( )
virtual

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

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ PlayFeedbacksOnlyIfReversed() [2/2]

override void MoreMountains.Feedbacks.MMF_Player.PlayFeedbacksOnlyIfReversed ( Vector3  position,
float  feedbacksIntensity = 1.0f,
bool  forceChangeDirection = false 
)
virtual

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

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ PreInitialization()

virtual void MoreMountains.Feedbacks.MMF_Player.PreInitialization ( )
virtual

◆ PreparePlay()

override void MoreMountains.Feedbacks.MMF_Player.PreparePlay ( Vector3  position,
float  feedbacksIntensity,
bool  forceChangeDirection = false 
)
protectedvirtual

◆ ProxyDestroy() [1/2]

virtual void MoreMountains.Feedbacks.MMF_Player.ProxyDestroy ( GameObject  gameObjectToDestroy)
virtual

Lets you destroy objects from feedbacks

Parameters
gameObjectToDestroy

◆ ProxyDestroy() [2/2]

virtual void MoreMountains.Feedbacks.MMF_Player.ProxyDestroy ( GameObject  gameObjectToDestroy,
float  delay 
)
virtual

Lets you destroy objects after a delay from feedbacks

Parameters
gameObjectToDestroy
delay

◆ ProxyDestroyImmediate()

virtual void MoreMountains.Feedbacks.MMF_Player.ProxyDestroyImmediate ( GameObject  gameObjectToDestroy)
virtual

Lets you DestroyImmediate objects from feedbacks

Parameters
gameObjectToDestroy

◆ RefreshCache()

virtual void MoreMountains.Feedbacks.MMF_Player.RefreshCache ( )
virtual

Refreshes cached feedbacks

◆ RemoveFeedback()

override void MoreMountains.Feedbacks.MMF_Player.RemoveFeedback ( int  id)
virtual

Removes the feedback at the specified index

Parameters
id

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ ResetAllCooldowns()

virtual void MoreMountains.Feedbacks.MMF_Player.ResetAllCooldowns ( )
virtual

Resets the cooldowns on this MMF Player, for the MMF Player itself and for all its feedbacks

◆ ResetCooldown()

virtual void MoreMountains.Feedbacks.MMF_Player.ResetCooldown ( )
virtual

Resets the cooldown on this MMF Player, letting you play it again instantly, regardless of its cooldown settings and how much time has passed since its last play

◆ ResetFeedbacks()

override void MoreMountains.Feedbacks.MMF_Player.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. It's usually called automatically before playing them.

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ ResetFeedbacksCooldowns()

virtual void MoreMountains.Feedbacks.MMF_Player.ResetFeedbacksCooldowns ( )
virtual

Resets cooldowns on all feedbacks, letting you play them again instantly, regardless of their cooldown settings and how much time has passed since their last play

◆ RestoreInitialValues()

virtual void MoreMountains.Feedbacks.MMF_Player.RestoreInitialValues ( )
virtual

Restores the initial state of this player, resetting its feedbacks target values to their initial values

◆ ResumeFeedbacks()

override void MoreMountains.Feedbacks.MMF_Player.ResumeFeedbacks ( )
virtual

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

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ SetDirection()

virtual void MoreMountains.Feedbacks.MMF_Player.SetDirection ( Directions  newDirection)
virtual

Sets the direction of the player to the one specified in parameters

◆ SetDirectionBottomToTop()

void MoreMountains.Feedbacks.MMF_Player.SetDirectionBottomToTop ( )

Sets the direction to bottom to top

◆ SetDirectionTopToBottom()

void MoreMountains.Feedbacks.MMF_Player.SetDirectionTopToBottom ( )

Sets the direction to top to bottom

◆ SkipToTheEnd()

virtual void MoreMountains.Feedbacks.MMF_Player.SkipToTheEnd ( )
virtual

Skips to the end of a sequence of feedbacks. Note that depending on your setup, this can take up to 3 frames to complete, don't disable your player instantly, or it won't complete the skipping

◆ SkipToTheEndCo()

virtual IEnumerator MoreMountains.Feedbacks.MMF_Player.SkipToTheEndCo ( )
protectedvirtual

◆ Start()

override void MoreMountains.Feedbacks.MMF_Player.Start ( )
protectedvirtual

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

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ StopFeedbacks() [1/3]

override void MoreMountains.Feedbacks.MMF_Player.StopFeedbacks ( )
virtual

Stops all further feedbacks from playing, as well as stopping individual feedbacks

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ StopFeedbacks() [2/3]

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

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

Reimplemented from MoreMountains.Feedbacks.MMFeedbacks.

◆ StopFeedbacks() [3/3]

override void MoreMountains.Feedbacks.MMF_Player.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 from MoreMountains.Feedbacks.MMFeedbacks.

◆ Update()

override void MoreMountains.Feedbacks.MMF_Player.Update ( )
protectedvirtual

Member Data Documentation

◆ _cachedTotalDuration

float MoreMountains.Feedbacks.MMF_Player._cachedTotalDuration
protected

◆ _initialized

bool MoreMountains.Feedbacks.MMF_Player._initialized = false
protected

◆ _t

Type MoreMountains.Feedbacks.MMF_Player._t
protected

◆ FeedbacksList

List<MMF_Feedback> MoreMountains.Feedbacks.MMF_Player.FeedbacksList

◆ KeepPlayModeChanges

bool MoreMountains.Feedbacks.MMF_Player.KeepPlayModeChanges = false

◆ PerformanceMode

bool MoreMountains.Feedbacks.MMF_Player.PerformanceMode = false

if this is true, the inspector won't refresh while the feedback plays, this saves on performance but feedback inspectors' progress bars for example won't look as smooth

◆ PlayCount

int MoreMountains.Feedbacks.MMF_Player.PlayCount = 0

how many times this player has started playing

◆ StopFeedbacksOnDisable

bool MoreMountains.Feedbacks.MMF_Player.StopFeedbacksOnDisable = false

if this is true, StopFeedbacks will be called on all feedbacks on Disable

Property Documentation

◆ HasAutomaticShakerSetup

virtual bool MoreMountains.Feedbacks.MMF_Player.HasAutomaticShakerSetup
get

Returns true if one or more of the feedbacks on this MMF Player have an option for automatic shaker setup, false otherwise

◆ SkippingToTheEnd

virtual bool MoreMountains.Feedbacks.MMF_Player.SkippingToTheEnd
getprotected set

◆ TotalDuration

override float MoreMountains.Feedbacks.MMF_Player.TotalDuration
get

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