Corgi Engine  v9.2
MoreMountains.Feedbacks.MMF_Position Class Reference

this feedback will let you animate the position of More...

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

Public Types

enum  Spaces { Spaces.World, Spaces.Local, Spaces.RectTransform, Spaces.Self }
 
enum  Modes { Modes.AtoB, Modes.AlongCurve, Modes.ToDestination }
 
enum  TimeScales { TimeScales.Scaled, TimeScales.Unscaled }
 

Public Member Functions

override void OnDisable ()
 On disable we reset our coroutine More...
 
override void OnValidate ()
 On Validate, we migrate our deprecated animation curves to our tween types if needed More...
 

Public Attributes

override bool HasRandomness => true
 sets the inspector color for this feedback More...
 
override bool CanForceInitialValue => true
 
override bool HasAutomatedTargetAcquisition => true
 
GameObject AnimatePositionTarget
 the object this feedback will animate the position for More...
 
Modes Mode = Modes.AtoB
 the mode this animation should follow (either going from A to B, or moving along a curve) More...
 
Spaces Space = Spaces.World
 the space in which to move the position in More...
 
bool RandomizeRemap = false
 whether or not to randomize remap values between their base and alt values on play, useful to add some variety every time you play this feedback More...
 
float AnimatePositionDuration = 0.2f
 the duration of the animation on play More...
 
MMTweenType AnimatePositionTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(1, 1)), "", "Mode", (int)Modes.AtoB, (int)Modes.ToDestination)
 the MMTween curve definition to use instead of the animation curve to define the acceleration of the movement More...
 
float RemapCurveZero = 0f
 the value to remap the curve's 0 value to More...
 
float RemapCurveZeroAlt = 0f
 in randomize remap mode, the value to remap the curve's 0 value to (randomized between this and RemapCurveZero) More...
 
float RemapCurveOne = 1f
 the value to remap the curve's 1 value to More...
 
float RemapCurveOneAlt = 1f
 in randomize remap mode, the value to remap the curve's 1 value to (randomized between this and RemapCurveOne) More...
 
bool AnimateX
 if this is true, the x position will be animated More...
 
MMTweenType AnimatePositionTweenX = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(0.6f, -1f), new Keyframe(1, 0f)), "AnimateX")
 the acceleration of the movement More...
 
bool AnimateY
 if this is true, the y position will be animated More...
 
MMTweenType AnimatePositionTweenY = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(0.6f, -1f), new Keyframe(1, 0f)), "AnimateY")
 the acceleration of the movement More...
 
bool AnimateZ
 if this is true, the z position will be animated More...
 
MMTweenType AnimatePositionTweenZ = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(0.6f, -1f), new Keyframe(1, 0f)), "AnimateZ")
 the acceleration of the movement More...
 
bool AllowAdditivePlays = false
 if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over More...
 
bool RelativePosition = true
 if this is true, movement will be relative to the object's initial position. So moving its y position along a curve going from 0 to 1 will move it up one unit. If this is false, in that same example, it'll be moved from 0 to 1 in absolute coordinates. More...
 
bool DeterminePositionsOnPlay = false
 if this is true, initial and destination positions will be recomputed on every play More...
 
Vector3 InitialPosition = Vector3.zero
 the initial position More...
 
Vector3 DestinationPosition = Vector3.one
 the destination position More...
 
Transform InitialPositionTransform
 the initial transform - if set, takes precedence over the Vector3 above More...
 
Transform DestinationPositionTransform
 the destination transform - if set, takes precedence over the Vector3 above More...
 
AnimationCurve AnimatePositionCurveX = null
 [DEPRECATED] the acceleration of the movement More...
 
AnimationCurve AnimatePositionCurveY = null
 [DEPRECATED] the acceleration of the movement More...
 
AnimationCurve AnimatePositionCurveZ = null
 [DEPRECATED] the acceleration of the movement More...
 
AnimationCurve AnimatePositionCurve = null
 [DEPRECATED] the acceleration of the movement - this is not used anymore, replaced by the AnimatePositionTween More...
 

Static Public Attributes

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

Protected Member Functions

override void AutomateTargetAcquisition ()
 A method meant to be implemented per feedback letting you specify what happens (usually setting a target) More...
 
override void CustomInitialization (MMF_Player owner)
 On init, we set our initial and destination positions (transform will take precedence over vector3s) More...
 
virtual void DeterminePositions ()
 
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On Play, we move our object from A to B More...
 
virtual IEnumerator MoveAlongCurve (GameObject movingObject, Vector3 initialPosition, float duration, float intensityMultiplier)
 Moves the object along a curve More...
 
virtual void ComputeNewCurvePosition (GameObject movingObject, Vector3 initialPosition, float percent, float intensityMultiplier)
 Evaluates the position curves and computes the new position More...
 
virtual IEnumerator MoveFromTo (GameObject movingObject, Vector3 pointA, Vector3 pointB, float duration, MMTweenType tweenType)
 Moves an object from point A to point B in a given time More...
 
virtual Vector3 GetPosition (Transform target)
 Gets the world, local or anchored position More...
 
virtual void SetPosition (Transform target, Vector3 newPosition)
 Sets the position, localposition or anchoredposition of the target More...
 
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On stop, we interrupt movement if it was active More...
 
override void CustomRestoreInitialValues ()
 On restore, we put our object back at its initial position More...
 

Protected Attributes

Vector3 _newPosition
 
Vector3 _currentPosition
 
RectTransform _rectTransform
 
Vector3 _initialPosition
 
Vector3 _destinationPosition
 
Coroutine _coroutine
 
Vector3 _workInitialPosition
 
Vector3 _workDestinationPosition
 
float _remapCurveZero
 
float _remapCurveOne
 

Properties

override float FeedbackDuration [get, set]
 the duration of this feedback is the duration of its animation More...
 

Detailed Description

this feedback will let you animate the position of

Member Enumeration Documentation

◆ Modes

Enumerator
AtoB 
AlongCurve 
ToDestination 

◆ Spaces

Enumerator
World 
Local 
RectTransform 
Self 

◆ TimeScales

Enumerator
Scaled 
Unscaled 

Member Function Documentation

◆ AutomateTargetAcquisition()

override void MoreMountains.Feedbacks.MMF_Position.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.

◆ ComputeNewCurvePosition()

virtual void MoreMountains.Feedbacks.MMF_Position.ComputeNewCurvePosition ( GameObject  movingObject,
Vector3  initialPosition,
float  percent,
float  intensityMultiplier 
)
protectedvirtual

Evaluates the position curves and computes the new position

Parameters
movingObject
initialPosition
percent

◆ CustomInitialization()

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

On init, we set our initial and destination positions (transform will take precedence over vector3s)

Parameters
owner

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomPlayFeedback()

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

On Play, we move our object from A to B

Parameters
position
feedbacksIntensity

Implements MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomRestoreInitialValues()

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

On restore, we put our object back at its initial position

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomStopFeedback()

override void MoreMountains.Feedbacks.MMF_Position.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.

◆ DeterminePositions()

virtual void MoreMountains.Feedbacks.MMF_Position.DeterminePositions ( )
protectedvirtual

◆ GetPosition()

virtual Vector3 MoreMountains.Feedbacks.MMF_Position.GetPosition ( Transform  target)
protectedvirtual

Gets the world, local or anchored position

Parameters
target
Returns

◆ MoveAlongCurve()

virtual IEnumerator MoreMountains.Feedbacks.MMF_Position.MoveAlongCurve ( GameObject  movingObject,
Vector3  initialPosition,
float  duration,
float  intensityMultiplier 
)
protectedvirtual

Moves the object along a curve

Parameters
movingObject
pointA
pointB
duration
curve
Returns

◆ MoveFromTo()

virtual IEnumerator MoreMountains.Feedbacks.MMF_Position.MoveFromTo ( GameObject  movingObject,
Vector3  pointA,
Vector3  pointB,
float  duration,
MMTweenType  tweenType 
)
protectedvirtual

Moves an object from point A to point B in a given time

Parameters
movingObjectMoving object.
pointAPoint a.
pointBPoint b.
durationTime.

◆ OnDisable()

override void MoreMountains.Feedbacks.MMF_Position.OnDisable ( )
virtual

On disable we reset our coroutine

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ OnValidate()

override void MoreMountains.Feedbacks.MMF_Position.OnValidate ( )
virtual

On Validate, we migrate our deprecated animation curves to our tween types if needed

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ SetPosition()

virtual void MoreMountains.Feedbacks.MMF_Position.SetPosition ( Transform  target,
Vector3  newPosition 
)
protectedvirtual

Sets the position, localposition or anchoredposition of the target

Parameters
target
newPosition

Member Data Documentation

◆ _coroutine

Coroutine MoreMountains.Feedbacks.MMF_Position._coroutine
protected

◆ _currentPosition

Vector3 MoreMountains.Feedbacks.MMF_Position._currentPosition
protected

◆ _destinationPosition

Vector3 MoreMountains.Feedbacks.MMF_Position._destinationPosition
protected

◆ _initialPosition

Vector3 MoreMountains.Feedbacks.MMF_Position._initialPosition
protected

◆ _newPosition

Vector3 MoreMountains.Feedbacks.MMF_Position._newPosition
protected

◆ _rectTransform

RectTransform MoreMountains.Feedbacks.MMF_Position._rectTransform
protected

◆ _remapCurveOne

float MoreMountains.Feedbacks.MMF_Position._remapCurveOne
protected

◆ _remapCurveZero

float MoreMountains.Feedbacks.MMF_Position._remapCurveZero
protected

◆ _workDestinationPosition

Vector3 MoreMountains.Feedbacks.MMF_Position._workDestinationPosition
protected

◆ _workInitialPosition

Vector3 MoreMountains.Feedbacks.MMF_Position._workInitialPosition
protected

◆ AllowAdditivePlays

bool MoreMountains.Feedbacks.MMF_Position.AllowAdditivePlays = false

if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over

◆ AnimatePositionCurve

AnimationCurve MoreMountains.Feedbacks.MMF_Position.AnimatePositionCurve = null

[DEPRECATED] the acceleration of the movement - this is not used anymore, replaced by the AnimatePositionTween

◆ AnimatePositionCurveX

AnimationCurve MoreMountains.Feedbacks.MMF_Position.AnimatePositionCurveX = null

[DEPRECATED] the acceleration of the movement

◆ AnimatePositionCurveY

AnimationCurve MoreMountains.Feedbacks.MMF_Position.AnimatePositionCurveY = null

[DEPRECATED] the acceleration of the movement

◆ AnimatePositionCurveZ

AnimationCurve MoreMountains.Feedbacks.MMF_Position.AnimatePositionCurveZ = null

[DEPRECATED] the acceleration of the movement

◆ AnimatePositionDuration

float MoreMountains.Feedbacks.MMF_Position.AnimatePositionDuration = 0.2f

the duration of the animation on play

◆ AnimatePositionTarget

GameObject MoreMountains.Feedbacks.MMF_Position.AnimatePositionTarget

the object this feedback will animate the position for

◆ AnimatePositionTween

MMTweenType MoreMountains.Feedbacks.MMF_Position.AnimatePositionTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(1, 1)), "", "Mode", (int)Modes.AtoB, (int)Modes.ToDestination)

the MMTween curve definition to use instead of the animation curve to define the acceleration of the movement

◆ AnimatePositionTweenX

MMTweenType MoreMountains.Feedbacks.MMF_Position.AnimatePositionTweenX = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(0.6f, -1f), new Keyframe(1, 0f)), "AnimateX")

the acceleration of the movement

◆ AnimatePositionTweenY

MMTweenType MoreMountains.Feedbacks.MMF_Position.AnimatePositionTweenY = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(0.6f, -1f), new Keyframe(1, 0f)), "AnimateY")

the acceleration of the movement

◆ AnimatePositionTweenZ

MMTweenType MoreMountains.Feedbacks.MMF_Position.AnimatePositionTweenZ = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(0.6f, -1f), new Keyframe(1, 0f)), "AnimateZ")

the acceleration of the movement

◆ AnimateX

bool MoreMountains.Feedbacks.MMF_Position.AnimateX

if this is true, the x position will be animated

◆ AnimateY

bool MoreMountains.Feedbacks.MMF_Position.AnimateY

if this is true, the y position will be animated

◆ AnimateZ

bool MoreMountains.Feedbacks.MMF_Position.AnimateZ

if this is true, the z position will be animated

◆ CanForceInitialValue

override bool MoreMountains.Feedbacks.MMF_Position.CanForceInitialValue => true

◆ DestinationPosition

Vector3 MoreMountains.Feedbacks.MMF_Position.DestinationPosition = Vector3.one

the destination position

◆ DestinationPositionTransform

Transform MoreMountains.Feedbacks.MMF_Position.DestinationPositionTransform

the destination transform - if set, takes precedence over the Vector3 above

◆ DeterminePositionsOnPlay

bool MoreMountains.Feedbacks.MMF_Position.DeterminePositionsOnPlay = false

if this is true, initial and destination positions will be recomputed on every play

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_Position.FeedbackTypeAuthorized = true
static

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

◆ HasAutomatedTargetAcquisition

override bool MoreMountains.Feedbacks.MMF_Position.HasAutomatedTargetAcquisition => true

◆ HasRandomness

override bool MoreMountains.Feedbacks.MMF_Position.HasRandomness => true

sets the inspector color for this feedback

◆ InitialPosition

Vector3 MoreMountains.Feedbacks.MMF_Position.InitialPosition = Vector3.zero

the initial position

◆ InitialPositionTransform

Transform MoreMountains.Feedbacks.MMF_Position.InitialPositionTransform

the initial transform - if set, takes precedence over the Vector3 above

◆ Mode

Modes MoreMountains.Feedbacks.MMF_Position.Mode = Modes.AtoB

the mode this animation should follow (either going from A to B, or moving along a curve)

◆ RandomizeRemap

bool MoreMountains.Feedbacks.MMF_Position.RandomizeRemap = false

whether or not to randomize remap values between their base and alt values on play, useful to add some variety every time you play this feedback

◆ RelativePosition

bool MoreMountains.Feedbacks.MMF_Position.RelativePosition = true

if this is true, movement will be relative to the object's initial position. So moving its y position along a curve going from 0 to 1 will move it up one unit. If this is false, in that same example, it'll be moved from 0 to 1 in absolute coordinates.

◆ RemapCurveOne

float MoreMountains.Feedbacks.MMF_Position.RemapCurveOne = 1f

the value to remap the curve's 1 value to

◆ RemapCurveOneAlt

float MoreMountains.Feedbacks.MMF_Position.RemapCurveOneAlt = 1f

in randomize remap mode, the value to remap the curve's 1 value to (randomized between this and RemapCurveOne)

◆ RemapCurveZero

float MoreMountains.Feedbacks.MMF_Position.RemapCurveZero = 0f

the value to remap the curve's 0 value to

◆ RemapCurveZeroAlt

float MoreMountains.Feedbacks.MMF_Position.RemapCurveZeroAlt = 0f

in randomize remap mode, the value to remap the curve's 0 value to (randomized between this and RemapCurveZero)

◆ Space

Spaces MoreMountains.Feedbacks.MMF_Position.Space = Spaces.World

the space in which to move the position in

Property Documentation

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_Position.FeedbackDuration
getset

the duration of this feedback is the duration of its animation


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