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_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 { World , Local , RectTransform , Self }
enum  Modes { AtoB , AlongCurve , ToDestination }
enum  MovementModes { Duration , Speed }
 whether to animate the scale over time or at a fixed speed More...

Public Member Functions

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

Public Attributes

GameObject AnimatePositionTarget
 the object this feedback will animate the position for
Modes Mode = Modes.AtoB
 the mode this animation should follow (either going from A to B, or moving along a curve)
Spaces Space = Spaces.World
 the space in which to move the position in
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
MovementModes MovementMode = MovementModes.Duration
 whether movement should occur over a fixed duration, or at a certain speed. Note that speed mode will only apply in AtoB and ToDestination modes
float AnimatePositionDuration = 0.2f
 the duration of the animation on play
float AnimatePositionSpeed = 1f
 in speed mode, the speed at which we should animate the position
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
float RemapCurveZero = 0f
 the value to remap the curve's 0 value to
float RemapCurveZeroAlt = 0f
 in randomize remap mode, the value to remap the curve's 0 value to (randomized between this and RemapCurveZero)
float RemapCurveOne = 1f
 the value to remap the curve's 1 value to
float RemapCurveOneAlt = 1f
 in randomize remap mode, the value to remap the curve's 1 value to (randomized between this and RemapCurveOne)
bool AnimateX
 if this is true, the x position will be animated
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
bool AnimateY
 if this is true, the y position will be animated
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
bool AnimateZ
 if this is true, the z position will be animated
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
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
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.
bool DeterminePositionsOnPlay = false
 if this is true, initial and destination positions will be recomputed on every play
Vector3 InitialPosition = Vector3.zero
 the initial position
Vector3 DestinationPosition = Vector3.one
 the destination position
Transform InitialPositionTransform
 the initial transform - if set, takes precedence over the Vector3 above
Transform DestinationPositionTransform
 the destination transform - if set, takes precedence over the Vector3 above
AnimationCurve AnimatePositionCurveX = null
 [DEPRECATED] the acceleration of the movement
AnimationCurve AnimatePositionCurveY = null
 [DEPRECATED] the acceleration of the movement
AnimationCurve AnimatePositionCurveZ = null
 [DEPRECATED] the acceleration of the movement
AnimationCurve AnimatePositionCurve = null
 [DEPRECATED] the acceleration of the movement - this is not used anymore, replaced by the AnimatePositionTween

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 set our initial and destination positions (transform will take precedence over vector3s)
virtual void DeterminePositions ()
virtual float HandleSpeedMode (Vector3 pointA, Vector3 pointB, float duration)
 In speed mode, computes the duration the feedback should last based on the distance between the two points and the speed.
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On Play, we move our object from A to B.
virtual IEnumerator MoveAlongCurve (GameObject movingObject, Vector3 initialPosition, float duration, float intensityMultiplier)
 Moves the object along a curve.
virtual void ComputeNewCurvePosition (GameObject movingObject, Vector3 initialPosition, float percent, float intensityMultiplier)
 Evaluates the position curves and computes the new position.
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.
virtual Vector3 GetPosition (Transform target)
 Gets the world, local or anchored position.
virtual void SetPosition (Transform target, Vector3 newPosition)
 Sets the position, localposition or anchoredposition of the target.
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On stop, we interrupt movement if it was active.
override void CustomRestoreInitialValues ()
 On restore, we put our object back at its initial position.

Protected Attributes

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

Properties

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

Detailed Description

this feedback will let you animate the position of

Member Enumeration Documentation

◆ Modes

Enumerator
AtoB 
AlongCurve 
ToDestination 

◆ MovementModes

whether to animate the scale over time or at a fixed speed

Enumerator
Duration 
Speed 

◆ Spaces

Enumerator
World 
Local 
RectTransform 
Self 

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 )
protected

On Play, we move our object from A to B.

Parameters
position
feedbacksIntensity

◆ 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

◆ HandleSpeedMode()

virtual float MoreMountains.Feedbacks.MMF_Position.HandleSpeedMode ( Vector3 pointA,
Vector3 pointB,
float duration )
protectedvirtual

In speed mode, computes the duration the feedback should last based on the distance between the two points and the speed.

Parameters
pointA
pointB
duration
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

◆ AnimatePositionSpeed

float MoreMountains.Feedbacks.MMF_Position.AnimatePositionSpeed = 1f

in speed mode, the speed at which we should animate the position

◆ 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

◆ 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

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

◆ MovementMode

MovementModes MoreMountains.Feedbacks.MMF_Position.MovementMode = MovementModes.Duration

whether movement should occur over a fixed duration, or at a certain speed. Note that speed mode will only apply in AtoB and ToDestination modes

◆ 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

◆ CanForceInitialValue

override bool MoreMountains.Feedbacks.MMF_Position.CanForceInitialValue
get

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_Position.FeedbackDuration
getset

the duration of this feedback is the duration of its animation

◆ HasAutomatedTargetAcquisition

override bool MoreMountains.Feedbacks.MMF_Position.HasAutomatedTargetAcquisition
get

◆ HasRandomness

override bool MoreMountains.Feedbacks.MMF_Position.HasRandomness
get

sets the inspector color for this feedback


The documentation for this class was generated from the following file:
  • H:/Code/MoreMountains/feel/Assets/Feel/MMFeedbacks/MMFeedbacks/Feedbacks/MMF_Position.cs