Feel  4.0.1
The best way to improve your game's feel and make it extra juicy
MoreMountains.Feedbacks.MMF_DestinationTransform Class Reference

This feedback will let you animate the position/rotation/scale of a target transform to match the one of a destination transform. More...

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

Public Types

enum  TimeScales { TimeScales.Scaled, TimeScales.Unscaled }
 the possible timescales this feedback can animate on More...
 

Public Member Functions

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

Public Attributes

override bool HasAutomatedTargetAcquisition => true
 sets the inspector color for this feedback More...
 
Transform TargetTransform
 the target transform we want to animate properties on More...
 
bool ForceOrigin = false
 whether or not we want to force an origin transform. If not, the current position of the target transform will be used as origin instead More...
 
Transform Origin
 the transform to use as origin in ForceOrigin mode More...
 
Transform Destination
 the destination transform whose properties we want to match More...
 
MMTweenType GlobalAnimationTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)))
 a global curve to animate all properties on, unless dedicated ones are specified More...
 
float Duration = 0.2f
 the duration of the transition, in seconds More...
 
bool AnimatePositionX = true
 whether or not to animate the X position More...
 
bool AnimatePositionY = true
 whether or not to animate the Y position More...
 
bool AnimatePositionZ = true
 whether or not to animate the Z position More...
 
bool AnimateRotationX = true
 whether or not to animate the X rotation More...
 
bool AnimateRotationY = true
 whether or not to animate the Y rotation More...
 
bool AnimateRotationZ = true
 whether or not to animate the Z rotation More...
 
bool AnimateRotationW = true
 whether or not to animate the W rotation More...
 
bool AnimateScaleX = true
 whether or not to animate the X scale More...
 
bool AnimateScaleY = true
 whether or not to animate the Y scale More...
 
bool AnimateScaleZ = true
 whether or not to animate the Z scale More...
 
bool SeparatePositionCurve = false
 whether or not to use a separate animation curve to animate the position More...
 
MMTweenType AnimatePositionTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)))
 the curve to use to animate the position on More...
 
bool SeparateRotationCurve = false
 whether or not to use a separate animation curve to animate the rotation More...
 
MMTweenType AnimateRotationTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)))
 the curve to use to animate the rotation on More...
 
bool SeparateScaleCurve = false
 whether or not to use a separate animation curve to animate the scale More...
 
MMTweenType AnimateScaleTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)))
 the curve to use to animate the scale on More...
 
AnimationCurve GlobalAnimationCurve = null
 a global curve to animate all properties on, unless dedicated ones are specified More...
 
AnimationCurve AnimateScaleCurve = null
 the curve to use to animate the position on More...
 
AnimationCurve AnimatePositionCurve = null
 the curve to use to animate the rotation on More...
 
AnimationCurve AnimateRotationCurve = null
 the curve to use to animate the scale on 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 CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On Play we animate the pos/rotation/scale of the target transform towards its destination More...
 
virtual IEnumerator AnimateToDestination ()
 A coroutine used to animate the pos/rotation/scale of the target transform towards its destination More...
 
virtual void ChangeTransformValues (float percent)
 Computes the new position, rotation and scale for our transform, and applies it to the transform More...
 
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1)
 On Stop we stop our coroutine if needed More...
 
override void CustomRestoreInitialValues ()
 On restore, we restore our initial state More...
 

Protected Attributes

Coroutine _coroutine
 
Vector3 _newPosition
 
Quaternion _newRotation
 
Vector3 _newScale
 
Vector3 _pointAPosition
 
Vector3 _pointBPosition
 
Quaternion _pointARotation
 
Quaternion _pointBRotation
 
Vector3 _pointAScale
 
Vector3 _pointBScale
 
MMTweenType _animationTweenType
 
Vector3 _initialPosition
 
Vector3 _initialScale
 
Quaternion _initialRotation
 

Properties

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

Detailed Description

This feedback will let you animate the position/rotation/scale of a target transform to match the one of a destination transform.

Member Enumeration Documentation

◆ TimeScales

the possible timescales this feedback can animate on

Enumerator
Scaled 
Unscaled 

Member Function Documentation

◆ AnimateToDestination()

virtual IEnumerator MoreMountains.Feedbacks.MMF_DestinationTransform.AnimateToDestination ( )
protectedvirtual

A coroutine used to animate the pos/rotation/scale of the target transform towards its destination

Returns

◆ AutomateTargetAcquisition()

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

◆ ChangeTransformValues()

virtual void MoreMountains.Feedbacks.MMF_DestinationTransform.ChangeTransformValues ( float  percent)
protectedvirtual

Computes the new position, rotation and scale for our transform, and applies it to the transform

Parameters
percent

◆ CustomPlayFeedback()

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

On Play we animate the pos/rotation/scale of the target transform towards its destination

Parameters
position
feedbacksIntensity

Implements MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomRestoreInitialValues()

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

On restore, we restore our initial state

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomStopFeedback()

override void MoreMountains.Feedbacks.MMF_DestinationTransform.CustomStopFeedback ( Vector3  position,
float  feedbacksIntensity = 1 
)
protectedvirtual

On Stop we stop our coroutine if needed

Parameters
position
feedbacksIntensity

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ OnValidate()

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

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

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

Member Data Documentation

◆ _animationTweenType

MMTweenType MoreMountains.Feedbacks.MMF_DestinationTransform._animationTweenType
protected

◆ _coroutine

Coroutine MoreMountains.Feedbacks.MMF_DestinationTransform._coroutine
protected

◆ _initialPosition

Vector3 MoreMountains.Feedbacks.MMF_DestinationTransform._initialPosition
protected

◆ _initialRotation

Quaternion MoreMountains.Feedbacks.MMF_DestinationTransform._initialRotation
protected

◆ _initialScale

Vector3 MoreMountains.Feedbacks.MMF_DestinationTransform._initialScale
protected

◆ _newPosition

Vector3 MoreMountains.Feedbacks.MMF_DestinationTransform._newPosition
protected

◆ _newRotation

Quaternion MoreMountains.Feedbacks.MMF_DestinationTransform._newRotation
protected

◆ _newScale

Vector3 MoreMountains.Feedbacks.MMF_DestinationTransform._newScale
protected

◆ _pointAPosition

Vector3 MoreMountains.Feedbacks.MMF_DestinationTransform._pointAPosition
protected

◆ _pointARotation

Quaternion MoreMountains.Feedbacks.MMF_DestinationTransform._pointARotation
protected

◆ _pointAScale

Vector3 MoreMountains.Feedbacks.MMF_DestinationTransform._pointAScale
protected

◆ _pointBPosition

Vector3 MoreMountains.Feedbacks.MMF_DestinationTransform._pointBPosition
protected

◆ _pointBRotation

Quaternion MoreMountains.Feedbacks.MMF_DestinationTransform._pointBRotation
protected

◆ _pointBScale

Vector3 MoreMountains.Feedbacks.MMF_DestinationTransform._pointBScale
protected

◆ AnimatePositionCurve

AnimationCurve MoreMountains.Feedbacks.MMF_DestinationTransform.AnimatePositionCurve = null

the curve to use to animate the rotation on

◆ AnimatePositionTween

MMTweenType MoreMountains.Feedbacks.MMF_DestinationTransform.AnimatePositionTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)))

the curve to use to animate the position on

◆ AnimatePositionX

bool MoreMountains.Feedbacks.MMF_DestinationTransform.AnimatePositionX = true

whether or not to animate the X position

◆ AnimatePositionY

bool MoreMountains.Feedbacks.MMF_DestinationTransform.AnimatePositionY = true

whether or not to animate the Y position

◆ AnimatePositionZ

bool MoreMountains.Feedbacks.MMF_DestinationTransform.AnimatePositionZ = true

whether or not to animate the Z position

◆ AnimateRotationCurve

AnimationCurve MoreMountains.Feedbacks.MMF_DestinationTransform.AnimateRotationCurve = null

the curve to use to animate the scale on

◆ AnimateRotationTween

MMTweenType MoreMountains.Feedbacks.MMF_DestinationTransform.AnimateRotationTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)))

the curve to use to animate the rotation on

◆ AnimateRotationW

bool MoreMountains.Feedbacks.MMF_DestinationTransform.AnimateRotationW = true

whether or not to animate the W rotation

◆ AnimateRotationX

bool MoreMountains.Feedbacks.MMF_DestinationTransform.AnimateRotationX = true

whether or not to animate the X rotation

◆ AnimateRotationY

bool MoreMountains.Feedbacks.MMF_DestinationTransform.AnimateRotationY = true

whether or not to animate the Y rotation

◆ AnimateRotationZ

bool MoreMountains.Feedbacks.MMF_DestinationTransform.AnimateRotationZ = true

whether or not to animate the Z rotation

◆ AnimateScaleCurve

AnimationCurve MoreMountains.Feedbacks.MMF_DestinationTransform.AnimateScaleCurve = null

the curve to use to animate the position on

◆ AnimateScaleTween

MMTweenType MoreMountains.Feedbacks.MMF_DestinationTransform.AnimateScaleTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)))

the curve to use to animate the scale on

◆ AnimateScaleX

bool MoreMountains.Feedbacks.MMF_DestinationTransform.AnimateScaleX = true

whether or not to animate the X scale

◆ AnimateScaleY

bool MoreMountains.Feedbacks.MMF_DestinationTransform.AnimateScaleY = true

whether or not to animate the Y scale

◆ AnimateScaleZ

bool MoreMountains.Feedbacks.MMF_DestinationTransform.AnimateScaleZ = true

whether or not to animate the Z scale

◆ Destination

Transform MoreMountains.Feedbacks.MMF_DestinationTransform.Destination

the destination transform whose properties we want to match

◆ Duration

float MoreMountains.Feedbacks.MMF_DestinationTransform.Duration = 0.2f

the duration of the transition, in seconds

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_DestinationTransform.FeedbackTypeAuthorized = true
static

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

◆ ForceOrigin

bool MoreMountains.Feedbacks.MMF_DestinationTransform.ForceOrigin = false

whether or not we want to force an origin transform. If not, the current position of the target transform will be used as origin instead

◆ GlobalAnimationCurve

AnimationCurve MoreMountains.Feedbacks.MMF_DestinationTransform.GlobalAnimationCurve = null

a global curve to animate all properties on, unless dedicated ones are specified

◆ GlobalAnimationTween

MMTweenType MoreMountains.Feedbacks.MMF_DestinationTransform.GlobalAnimationTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)))

a global curve to animate all properties on, unless dedicated ones are specified

◆ HasAutomatedTargetAcquisition

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

sets the inspector color for this feedback

◆ Origin

Transform MoreMountains.Feedbacks.MMF_DestinationTransform.Origin

the transform to use as origin in ForceOrigin mode

◆ SeparatePositionCurve

bool MoreMountains.Feedbacks.MMF_DestinationTransform.SeparatePositionCurve = false

whether or not to use a separate animation curve to animate the position

◆ SeparateRotationCurve

bool MoreMountains.Feedbacks.MMF_DestinationTransform.SeparateRotationCurve = false

whether or not to use a separate animation curve to animate the rotation

◆ SeparateScaleCurve

bool MoreMountains.Feedbacks.MMF_DestinationTransform.SeparateScaleCurve = false

whether or not to use a separate animation curve to animate the scale

◆ TargetTransform

Transform MoreMountains.Feedbacks.MMF_DestinationTransform.TargetTransform

the target transform we want to animate properties on

Property Documentation

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_DestinationTransform.FeedbackDuration
getset

the duration of this feedback is the duration of the movement


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