Feel 5.9.1
The best way to improve your game's feel and make it extra juicy
Loading...
Searching...
No Matches
MoreMountains.Feedbacks.MMF_Player Class Reference
Inheritance diagram for MoreMountains.Feedbacks.MMF_Player:
MoreMountains.Feedbacks.MMFeedbacks MoreMountains.Tools.MMEventListener< T > MoreMountains.Tools.MMEventListenerBase

Public Types

enum  AccessMethods {
  First , Previous , Closest , Next ,
  Last
}
Public Types inherited from MoreMountains.Feedbacks.MMFeedbacks
enum  Directions { TopToBottom , BottomToTop }
 the possible directions MMFeedbacks can be played More...
enum  SafeModes { Nope , EditorOnly , RuntimeOnly , Full }
enum  InitializationModes { Script , Awake , Start , OnEnable }

Public Member Functions

virtual IEnumerator PlayFeedbacksAfterFrames (int framesAmount)
 A coroutine you can start to play this player's feedbacks after X frames.
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.
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.
override void PlayFeedbacks ()
 Plays all feedbacks using the MMFeedbacks' position as reference, and no attenuation.
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.
override void PlayFeedbacksInReverse ()
 Plays all feedbacks using the MMFeedbacks' position as reference, and no attenuation, and in reverse (from bottom to top)
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)
override void PlayFeedbacksOnlyIfReversed ()
 Plays all feedbacks in the sequence, but only if this MMFeedbacks is playing in reverse order.
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.
override void PlayFeedbacksOnlyIfNormalDirection ()
 Plays all feedbacks in the sequence, but only if this MMFeedbacks is playing in normal order.
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.
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);.
virtual void PlayFeedbacksTopToBottom ()
 Plays all feedbacks in the sequence from top to bottom.
virtual void PlayFeedbacksBottomToTop ()
 Plays all feedbacks in the sequence from bottom to top.
virtual bool IsAllowedToPlay (Vector3 position)
 Returns true if this feedback is allowed to play, false otherwise.
override void StopFeedbacks ()
 Stops all further feedbacks from playing, as well as stopping individual feedbacks.
override void StopFeedbacks (bool stopAllFeedbacks=true)
 Stops all feedbacks from playing, with an option to also stop individual feedbacks.
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.
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.
override void ChangeDirection ()
 Changes the direction of this MMFeedbacks.
virtual void SetDirection (Directions newDirection)
 Sets the direction of the player to the one specified in parameters.
void SetDirectionTopToBottom ()
 Sets the direction to top to bottom.
void SetDirectionBottomToTop ()
 Sets the direction to bottom to top.
virtual void PlayerCompleteFeedbacks ()
 When the player is done playing, we call PlayerComplete on all its feedbacks to let them know the player is done.
override void PauseFeedbacks ()
 Pauses execution of a sequence, which can then be resumed by calling ResumeFeedbacks()
virtual void RestoreInitialValues ()
 Restores the initial state of this player, resetting its feedbacks target values to their initial values.
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.
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.
override void ResumeFeedbacks ()
 Resumes execution of a sequence if a script driven pause is in progress.
virtual void ResetAllCooldowns ()
 Resets the cooldowns on this MMF Player, for the MMF Player itself and for all its feedbacks.
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.
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.
virtual void AddFeedback (MMF_Feedback newFeedback, bool copy=false)
 Adds the specified MMF_Feedback to the player.
new MMF_Feedback AddFeedback (System.Type feedbackType, bool add=true)
 Adds a feedback of the specified type to the player.
override void RemoveFeedback (int id)
 Removes the feedback at the specified index.
virtual void CopyPlayerFrom (MMF_Player source)
 Replaces the current feedback list and player settings with the ones on the target MMF Player.
virtual void CopyFeedbackListFrom (MMF_Player source)
 Replaces the current feedback list with the feedbacks on the target MMF Player.
virtual void AddFeedbackListFrom (MMF_Player source)
 Adds the feedbacks on the target MMF Player to the current feedback list.
virtual void AutomaticShakerSetup ()
 Calls the AutomaticShakerSetup method on all feedbacks that have it.
override bool HasFeedbackStillPlaying ()
 Returns true if feedbacks are still playing.
virtual float ComputeRangeIntensityMultiplier (Vector3 position)
 Determines the intensity multiplier to apply.
override float ApplyTimeMultiplier (float duration)
 Applies this feedback's time multiplier to a duration (in seconds)
virtual void ProxyDestroy (GameObject gameObjectToDestroy)
 Lets you destroy objects from feedbacks.
virtual void ProxyDestroy (GameObject gameObjectToDestroy, float delay)
 Lets you destroy objects after a delay from feedbacks.
virtual void ProxyDestroyImmediate (GameObject gameObjectToDestroy)
 Lets you DestroyImmediate objects from feedbacks.
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.
virtual T GetFeedbackOfType< T > ()
 Returns the first feedback of the searched type on this MMF_Player.
virtual List< T > GetFeedbacksOfType< T > ()
 Returns a list of all the feedbacks of the searched type on this MMF_Player.
virtual T GetFeedbackOfType< T > (string searchedLabel)
 Returns the first feedback of the searched type on this MMF_Player.
virtual List< T > GetFeedbacksOfType< T > (string searchedLabel)
 Returns a list of all the feedbacks of the searched type on this MMF_Player.
void OnMMEvent (MMF_PlayerEvent mmfPlayerEvent)
 Catches MMF_PlayerEvents and plays this MMF Player if the channel matches.
virtual void RefreshCache ()
 Refreshes cached feedbacks.
virtual void ComputeCachedTotalDuration ()
 Computes the total duration of the player's sequence of feedbacks.
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.
virtual async System.Threading.Tasks.Task PlayFeedbacksTask ()
 Plays all feedbacks and awaits until completion.
virtual void SetCanPlay (bool newState)
 Use this method to authorize or prevent this player from being played.
virtual void AutoRepair ()
 Unity sometimes has serialization issues. This method fixes that by fixing any bad sync that could happen.
Public Member Functions inherited from MoreMountains.Tools.MMEventListener< T >
void OnMMEvent (T eventType)

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
bool RestoreInitialValuesOnDisable = false
 if this is true, RestoreInitialValues will be called on all feedbacks on Disable
bool StopFeedbacksOnDisable = false
 if this is true, StopFeedbacks will be called on all feedbacks on Disable
int PlayCount = 0
 how many times this player has started playing
MMChannelModes MMF_ChannelMode = MMChannelModes.Int
int MMF_Channel = 0
 the channel to listen to - has to match the one on the feedback/event you use to trigger it
MMChannel MMF_ChannelDefinition = null
Public Attributes inherited from MoreMountains.Feedbacks.MMFeedbacks
List< MMFeedbackFeedbacks = new List<MMFeedback>()
 a list of MMFeedback to trigger
InitializationModes InitializationMode = InitializationModes.Start
 the chosen initialization mode
bool AutoInitialization = true
 if you set this to true, the system will make changes to ensure that initialization always happens before play
SafeModes SafeMode = SafeModes.Full
 the selected safe mode
Directions Direction = Directions.TopToBottom
 the selected direction
bool AutoChangeDirectionOnEnd = false
 whether or not this MMFeedbacks should invert its direction when all feedbacks have played
bool AutoPlayOnStart = false
 whether or not to play this feedbacks automatically on Start
bool AutoPlayOnEnable = false
 whether or not to play this feedbacks automatically on Enable
bool ForceTimescaleMode = false
 if this is true, all feedbacks within that player will work on the specified ForcedTimescaleMode, regardless of their individual settings
TimescaleModes ForcedTimescaleMode = TimescaleModes.Unscaled
 the time scale mode all feedbacks on this player should work on, if ForceTimescaleMode is true
float DurationMultiplier = 1f
 a time multiplier that will be applied to all feedback durations (initial delay, duration, delay between repeats...)
float TimescaleMultiplier = 1f
 a multiplier to apply to all timescale operations (1: normal, less than 1: slower operations, higher than 1: faster operations)
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
Vector2 RandomDurationMultiplier = new Vector2(0.5f, 1.5f)
 if RandomizeDuration is true, the min (x) and max (y) values for the random duration multiplier
bool DisplayFullDurationDetails = false
 if this is true, more editor-only, detailed info will be displayed per feedback in the duration slot
TimescaleModes PlayerTimescaleMode = TimescaleModes.Scaled
 the timescale at which the player itself will operate. This notably impacts sequencing and pauses duration evaluation.
bool OnlyPlayIfWithinRange = false
 if this is true, this feedback will only play if its distance to RangeCenter is lower or equal to RangeDistance
Transform RangeCenter
 when in OnlyPlayIfWithinRange mode, the transform to consider as the center of the range
float RangeDistance = 5f
 when in OnlyPlayIfWithinRange mode, the distance to the center within which the feedback will play
bool UseRangeFalloff = false
 when in OnlyPlayIfWithinRange mode, whether or not to modify the intensity of feedbacks based on the RangeFallOff curve
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)
Vector2 RemapRangeFalloff = new Vector2(0f, 1f)
 the values to remap the falloff curve's y axis' 0 and 1
bool IgnoreRangeEvents = false
 whether or not to ignore MMSetFeedbackRangeCenterEvent, used to set the RangeCenter from anywhere
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
float InitialDelay = 0f
 a duration, in seconds, to delay the start of this MMFeedbacks' contents play
bool CanPlay = true
 whether this player can be played or not, useful to temporarily prevent play from another class, for example
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
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)
float FeedbacksIntensity = 1f
MMFeedbacksEvents Events
 a number of UnityEvents that can be triggered at the various stages of this MMFeedbacks
bool DebugActive = false
 whether or not this MMFeedbacks is in debug mode
bool InScriptDrivenPause
 whether or not the execution of this MMFeedbacks' sequence is being prevented and waiting for a Resume() call

Protected Member Functions

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

Protected Attributes

Type _t
float _cachedTotalDuration
bool _initialized = false
Coroutine _pausedFeedbacksCo
bool _listening = 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.
Properties inherited from MoreMountains.Feedbacks.MMFeedbacks
bool IsPlaying [get, protected set]
virtual float ElapsedTime [get]
 if this MMFeedbacks is playing the time since it started playing
int TimesPlayed [get, protected set]
 the amount of times this MMFeedbacks has been played
bool ContainsLoop [get, set]
 true if this MMFeedbacks contains at least one loop
bool ShouldChangeDirectionOnNextPlay [get, set]
 true if this feedback should change play direction next time it's played
bool ForcingUnscaledTimescaleMode [get]
 true if this player is forcing unscaled mode
virtual float TotalDuration [get]
 The total duration (in seconds) of all the active feedbacks in this MMFeedbacks.
virtual float ComputedInitialDelay [get]

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
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,
bool copy = false )
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.

◆ OnMMEvent()

void MoreMountains.Feedbacks.MMF_Player.OnMMEvent ( MMF_PlayerEvent mmfPlayerEvent)

Catches MMF_PlayerEvents and plays this MMF Player if the channel matches.

Parameters
mmfPlayerEvent

◆ 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

◆ PlayFeedbacksBottomToTop()

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

Plays all feedbacks in the sequence from bottom to top.

◆ 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.

◆ PlayFeedbacksTopToBottom()

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

Plays all feedbacks in the sequence from top to bottom.

◆ 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

◆ _listening

bool MoreMountains.Feedbacks.MMF_Player._listening = false
protected

◆ _pausedFeedbacksCo

Coroutine MoreMountains.Feedbacks.MMF_Player._pausedFeedbacksCo
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

◆ MMF_Channel

int MoreMountains.Feedbacks.MMF_Player.MMF_Channel = 0

the channel to listen to - has to match the one on the feedback/event you use to trigger it

◆ MMF_ChannelDefinition

MMChannel MoreMountains.Feedbacks.MMF_Player.MMF_ChannelDefinition = null

the MMChannel definition asset to use to listen for events. The feedbacks targeting this shaker will have to reference that same MMChannel definition to receive events - to create a MMChannel, right click anywhere in your project (usually in a Data folder) and go MoreMountains > MMChannel, then name it with some unique name

◆ MMF_ChannelMode

MMChannelModes MoreMountains.Feedbacks.MMF_Player.MMF_ChannelMode = MMChannelModes.Int

you can use MMF_PlayerEvents to trigger any MMF Player listening on the corresponding MMChannel This field lets you define whether this MMF Player should listen on a channel defined by an int or by a MMChannel scriptable object. Ints are simple to setup but can get messy and make it harder to remember what int corresponds to what. MMChannel scriptable objects require you to create them in advance, but come with a readable name and are more scalable

◆ 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

◆ RestoreInitialValuesOnDisable

bool MoreMountains.Feedbacks.MMF_Player.RestoreInitialValuesOnDisable = false

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

◆ 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:
  • H:/Code/MoreMountains/feel/Assets/Feel/MMFeedbacks/MMFeedbacks/Core/MMF_Player/MMF_Player.cs