TopDown Engine v4.5
Loading...
Searching...
No Matches
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 { Scaled , 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.

Public Attributes

Transform TargetTransform
 the target transform we want to animate properties on
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
Transform Origin
 the transform to use as origin in ForceOrigin mode
Transform Destination
 the destination transform whose properties we want to match
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
float Duration = 0.2f
 the duration of the transition, in seconds
bool UpdateDestinationEveryFrame = false
 if this is true, the destination will be updated every frame, allowing for dynamic changes to the destination transform, otherwise the destination will be cached on init and not updated after that
bool AnimatePositionX = true
 whether or not to animate the X position
bool AnimatePositionY = true
 whether or not to animate the Y position
bool AnimatePositionZ = true
 whether or not to animate the Z position
bool AnimateRotationX = true
 whether or not to animate the X rotation
bool AnimateRotationY = true
 whether or not to animate the Y rotation
bool AnimateRotationZ = true
 whether or not to animate the Z rotation
bool AnimateRotationW = true
 whether or not to animate the W rotation
bool AnimateScaleX = true
 whether or not to animate the X scale
bool AnimateScaleY = true
 whether or not to animate the Y scale
bool AnimateScaleZ = true
 whether or not to animate the Z scale
bool SeparatePositionCurve = false
 whether or not to use a separate animation curve to animate the position
MMTweenType AnimatePositionTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)), "SeparatePositionCurve")
 the curve to use to animate the position on
bool SeparateRotationCurve = false
 whether or not to use a separate animation curve to animate the rotation
MMTweenType AnimateRotationTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)), "SeparateRotationCurve")
 the curve to use to animate the rotation on
bool SeparateScaleCurve = false
 whether or not to use a separate animation curve to animate the scale
MMTweenType AnimateScaleTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)), "SeparateScaleCurve")
 the curve to use to animate the scale on
AnimationCurve GlobalAnimationCurve = null
 a global curve to animate all properties on, unless dedicated ones are specified
AnimationCurve AnimateScaleCurve = null
 the curve to use to animate the position on
AnimationCurve AnimatePositionCurve = null
 the curve to use to animate the rotation on
AnimationCurve AnimateRotationCurve = null
 the curve to use to animate the scale on

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 CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On Play we animate the pos/rotation/scale of the target transform towards its destination.
virtual IEnumerator AnimateToDestination ()
 A coroutine used to animate the pos/rotation/scale of the target transform towards its destination.
virtual void CacheDestinationValues ()
virtual void ChangeTransformValues (float percent)
 Computes the new position, rotation and scale for our transform, and applies it to the transform.
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1)
 On Stop we stop our coroutine if needed.
override void CustomRestoreInitialValues ()
 On restore, we restore our initial state.

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 bool HasAutomatedTargetAcquisition [get]
 sets the inspector color for this feedback
override float FeedbackDuration [get, set]
 the duration of this feedback is the duration of the movement

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.

◆ CacheDestinationValues()

virtual void MoreMountains.Feedbacks.MMF_DestinationTransform.CacheDestinationValues ( )
protectedvirtual

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

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

Parameters
position
feedbacksIntensity

◆ 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)), "SeparatePositionCurve")

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)), "SeparateRotationCurve")

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)), "SeparateScaleCurve")

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

◆ 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

◆ UpdateDestinationEveryFrame

bool MoreMountains.Feedbacks.MMF_DestinationTransform.UpdateDestinationEveryFrame = false

if this is true, the destination will be updated every frame, allowing for dynamic changes to the destination transform, otherwise the destination will be cached on init and not updated after that

Property Documentation

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_DestinationTransform.FeedbackDuration
getset

the duration of this feedback is the duration of the movement

◆ HasAutomatedTargetAcquisition

override bool MoreMountains.Feedbacks.MMF_DestinationTransform.HasAutomatedTargetAcquisition
get

sets the inspector color for this feedback


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