TopDown Engine v4.5
Loading...
Searching...
No Matches
MoreMountains.Feedbacks.MMF_PositionSpring Class Reference

This feedback will let you animate the position of the target object over time, with a spring effect. More...

Inheritance diagram for MoreMountains.Feedbacks.MMF_PositionSpring:
MoreMountains.Feedbacks.MMF_Feedback

Public Types

enum  Modes { MoveTo , MoveToAdditive , Bump }
enum  Spaces { World , Local , RectTransform }

Public Attributes

Transform AnimatePositionTarget
 the object to animate
float DeclaredDuration = 0f
 spring duration is determined by the spring (and could be impacted real time), so it's up to you to determine how long this feedback should last, from the point of view of its parent MMF Player
Spaces Space = Spaces.World
 the space in which to move the position in
float DampingX = 0.4f
 the dumping ratio determines how fast the spring will evolve after a disturbance. At a low value, it'll oscillate for a long time, while closer to 1 it'll stop oscillating quickly
float FrequencyX = 6f
 the frequency determines how fast the spring will oscillate when disturbed, low frequency means less oscillations per second, high frequency means more oscillations per second
float DampingY = 0.4f
 the dumping ratio determines how fast the spring will evolve after a disturbance. At a low value, it'll oscillate for a long time, while closer to 1 it'll stop oscillating quickly
float FrequencyY = 6f
 the frequency determines how fast the spring will oscillate when disturbed, low frequency means less oscillations per second, high frequency means more oscillations per second
float DampingZ = 0.4f
 the dumping ratio determines how fast the spring will evolve after a disturbance. At a low value, it'll oscillate for a long time, while closer to 1 it'll stop oscillating quickly
float FrequencyZ = 6f
 the frequency determines how fast the spring will oscillate when disturbed, low frequency means less oscillations per second, high frequency means more oscillations per second
Modes Mode = Modes.Bump
 the chosen mode for this spring. MoveTo will move the target the specified position (randomized between min and max). MoveToAdditive will add the specified position (randomized between min and max) to the target's current position. Bump will bump the target's position by the specified power (randomized between min and max)
Vector3 MoveToPositionMin = new Vector3(1f, 1f, 1f)
 the min value from which to pick a random target value when in MoveTo or MoveToAdditive modes
Vector3 MoveToPositionMax = new Vector3(2f, 2f, 2f)
 the max value from which to pick a random target value when in MoveTo or MoveToAdditive modes
Transform MoveToTransform
 an optional transform you can use to determine the target position. If this is set, the MoveToPositionMin and MoveToPositionMax values will be used as offsets from this transform's position in Additive mode
Vector3 BumpPositionMin = new Vector3(0f, 20f, 0f)
 the min value from which to pick a random bump amount when in Bump mode
Vector3 BumpPositionMax = new Vector3(0f, 30f, 0f)
 the max value from which to pick a random bump amount when in Bump mode
bool ForceAbsolute = false

Static Public Attributes

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

Protected Member Functions

override void AutomateTargetAcquisition ()
 A method meant to be implemented per feedback letting you specify what happens (usually setting a target)
override void CustomInitialization (MMF_Player owner)
 On init we store our initial position.
virtual void GetInitialValues ()
 Stores initial position for future use.
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On Play, triggers the position animation.
virtual IEnumerator Spring ()
 a coroutine running on the Owner used to move the spring
virtual void UpdateSpring ()
 Updates the spring's values.
virtual void ApplyValue ()
 Applies the current spring value to the target.
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On stop, we interrupt movement if it was active.
override void CustomSkipToTheEnd (Vector3 position, float feedbacksIntensity=1.0f)
 Skips to the end, matching the target value.
override void CustomRestoreInitialValues ()
 On restore, we restore our initial state.

Protected Attributes

Vector3 _currentValue = Vector3.zero
Vector3 _targetValue = Vector3.zero
Vector3 _velocity = Vector3.zero
Vector3 _initialTargetValue = Vector3.zero
Vector3 _initialPosition
Coroutine _coroutine
float _velocityLowThreshold = 0.001f
RectTransform _rectTransform
Vector3 _appliedPosition

Properties

override bool HasAutomatedTargetAcquisition [get]
 sets the inspector color for this feedback
override bool CanForceInitialValue [get]
override float FeedbackDuration [get, set]
 the duration of this feedback is the duration of the position animation
override bool HasRandomness [get]
virtual bool LowVelocity [get]

Additional Inherited Members

Detailed Description

This feedback will let you animate the position of the target object over time, with a spring effect.

Member Enumeration Documentation

◆ Modes

Enumerator
MoveTo 
MoveToAdditive 
Bump 

◆ Spaces

Enumerator
World 
Local 
RectTransform 

Member Function Documentation

◆ ApplyValue()

virtual void MoreMountains.Feedbacks.MMF_PositionSpring.ApplyValue ( )
protectedvirtual

Applies the current spring value to the target.

◆ AutomateTargetAcquisition()

override void MoreMountains.Feedbacks.MMF_PositionSpring.AutomateTargetAcquisition ( )
protectedvirtual

A method meant to be implemented per feedback letting you specify what happens (usually setting a target)

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomInitialization()

override void MoreMountains.Feedbacks.MMF_PositionSpring.CustomInitialization ( MMF_Player owner)
protectedvirtual

On init we store our initial position.

Parameters
owner

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomPlayFeedback()

override void MoreMountains.Feedbacks.MMF_PositionSpring.CustomPlayFeedback ( Vector3 position,
float feedbacksIntensity = 1::0f )
protected

On Play, triggers the position animation.

Parameters
position
feedbacksIntensity

◆ CustomRestoreInitialValues()

override void MoreMountains.Feedbacks.MMF_PositionSpring.CustomRestoreInitialValues ( )
protectedvirtual

On restore, we restore our initial state.

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomSkipToTheEnd()

override void MoreMountains.Feedbacks.MMF_PositionSpring.CustomSkipToTheEnd ( Vector3 position,
float feedbacksIntensity = 1::0f )
protectedvirtual

Skips to the end, matching the target value.

Parameters
position
feedbacksIntensity

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomStopFeedback()

override void MoreMountains.Feedbacks.MMF_PositionSpring.CustomStopFeedback ( Vector3 position,
float feedbacksIntensity = 1::0f )
protectedvirtual

On stop, we interrupt movement if it was active.

Parameters
position
feedbacksIntensity

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ GetInitialValues()

virtual void MoreMountains.Feedbacks.MMF_PositionSpring.GetInitialValues ( )
protectedvirtual

Stores initial position for future use.

◆ Spring()

virtual IEnumerator MoreMountains.Feedbacks.MMF_PositionSpring.Spring ( )
protectedvirtual

a coroutine running on the Owner used to move the spring

Returns

◆ UpdateSpring()

virtual void MoreMountains.Feedbacks.MMF_PositionSpring.UpdateSpring ( )
protectedvirtual

Updates the spring's values.

Member Data Documentation

◆ _appliedPosition

Vector3 MoreMountains.Feedbacks.MMF_PositionSpring._appliedPosition
protected

◆ _coroutine

Coroutine MoreMountains.Feedbacks.MMF_PositionSpring._coroutine
protected

◆ _currentValue

Vector3 MoreMountains.Feedbacks.MMF_PositionSpring._currentValue = Vector3.zero
protected

◆ _initialPosition

Vector3 MoreMountains.Feedbacks.MMF_PositionSpring._initialPosition
protected

◆ _initialTargetValue

Vector3 MoreMountains.Feedbacks.MMF_PositionSpring._initialTargetValue = Vector3.zero
protected

◆ _rectTransform

RectTransform MoreMountains.Feedbacks.MMF_PositionSpring._rectTransform
protected

◆ _targetValue

Vector3 MoreMountains.Feedbacks.MMF_PositionSpring._targetValue = Vector3.zero
protected

◆ _velocity

Vector3 MoreMountains.Feedbacks.MMF_PositionSpring._velocity = Vector3.zero
protected

◆ _velocityLowThreshold

float MoreMountains.Feedbacks.MMF_PositionSpring._velocityLowThreshold = 0.001f
protected

◆ AnimatePositionTarget

Transform MoreMountains.Feedbacks.MMF_PositionSpring.AnimatePositionTarget

the object to animate

◆ BumpPositionMax

Vector3 MoreMountains.Feedbacks.MMF_PositionSpring.BumpPositionMax = new Vector3(0f, 30f, 0f)

the max value from which to pick a random bump amount when in Bump mode

◆ BumpPositionMin

Vector3 MoreMountains.Feedbacks.MMF_PositionSpring.BumpPositionMin = new Vector3(0f, 20f, 0f)

the min value from which to pick a random bump amount when in Bump mode

◆ DampingX

float MoreMountains.Feedbacks.MMF_PositionSpring.DampingX = 0.4f

the dumping ratio determines how fast the spring will evolve after a disturbance. At a low value, it'll oscillate for a long time, while closer to 1 it'll stop oscillating quickly

◆ DampingY

float MoreMountains.Feedbacks.MMF_PositionSpring.DampingY = 0.4f

the dumping ratio determines how fast the spring will evolve after a disturbance. At a low value, it'll oscillate for a long time, while closer to 1 it'll stop oscillating quickly

◆ DampingZ

float MoreMountains.Feedbacks.MMF_PositionSpring.DampingZ = 0.4f

the dumping ratio determines how fast the spring will evolve after a disturbance. At a low value, it'll oscillate for a long time, while closer to 1 it'll stop oscillating quickly

◆ DeclaredDuration

float MoreMountains.Feedbacks.MMF_PositionSpring.DeclaredDuration = 0f

spring duration is determined by the spring (and could be impacted real time), so it's up to you to determine how long this feedback should last, from the point of view of its parent MMF Player

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_PositionSpring.FeedbackTypeAuthorized = true
static

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

◆ ForceAbsolute

bool MoreMountains.Feedbacks.MMF_PositionSpring.ForceAbsolute = false

◆ FrequencyX

float MoreMountains.Feedbacks.MMF_PositionSpring.FrequencyX = 6f

the frequency determines how fast the spring will oscillate when disturbed, low frequency means less oscillations per second, high frequency means more oscillations per second

◆ FrequencyY

float MoreMountains.Feedbacks.MMF_PositionSpring.FrequencyY = 6f

the frequency determines how fast the spring will oscillate when disturbed, low frequency means less oscillations per second, high frequency means more oscillations per second

◆ FrequencyZ

float MoreMountains.Feedbacks.MMF_PositionSpring.FrequencyZ = 6f

the frequency determines how fast the spring will oscillate when disturbed, low frequency means less oscillations per second, high frequency means more oscillations per second

◆ Mode

Modes MoreMountains.Feedbacks.MMF_PositionSpring.Mode = Modes.Bump

the chosen mode for this spring. MoveTo will move the target the specified position (randomized between min and max). MoveToAdditive will add the specified position (randomized between min and max) to the target's current position. Bump will bump the target's position by the specified power (randomized between min and max)

◆ MoveToPositionMax

Vector3 MoreMountains.Feedbacks.MMF_PositionSpring.MoveToPositionMax = new Vector3(2f, 2f, 2f)

the max value from which to pick a random target value when in MoveTo or MoveToAdditive modes

◆ MoveToPositionMin

Vector3 MoreMountains.Feedbacks.MMF_PositionSpring.MoveToPositionMin = new Vector3(1f, 1f, 1f)

the min value from which to pick a random target value when in MoveTo or MoveToAdditive modes

◆ MoveToTransform

Transform MoreMountains.Feedbacks.MMF_PositionSpring.MoveToTransform

an optional transform you can use to determine the target position. If this is set, the MoveToPositionMin and MoveToPositionMax values will be used as offsets from this transform's position in Additive mode

◆ Space

Spaces MoreMountains.Feedbacks.MMF_PositionSpring.Space = Spaces.World

the space in which to move the position in

Property Documentation

◆ CanForceInitialValue

override bool MoreMountains.Feedbacks.MMF_PositionSpring.CanForceInitialValue
get

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_PositionSpring.FeedbackDuration
getset

the duration of this feedback is the duration of the position animation

◆ HasAutomatedTargetAcquisition

override bool MoreMountains.Feedbacks.MMF_PositionSpring.HasAutomatedTargetAcquisition
get

sets the inspector color for this feedback

◆ HasRandomness

override bool MoreMountains.Feedbacks.MMF_PositionSpring.HasRandomness
get

◆ LowVelocity

virtual bool MoreMountains.Feedbacks.MMF_PositionSpring.LowVelocity
getprotected

The documentation for this class was generated from the following file:
  • H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/ThirdParty/MoreMountains/MMFeedbacks/MMFeedbacks/Feedbacks/MMF_PositionSpring.cs