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_RotatePositionAround Class Reference

This feedback will animate the target's position (not its rotation), on an arc around the specified rotation center, for the specified duration (in seconds). More...

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

Public Types

enum  TimeScales { Scaled , Unscaled }
 the timescale modes this feedback can operate on More...

Public Member Functions

override void OnDisable ()
 On disable we reset our coroutine.

Public Attributes

Transform AnimateRotationTarget
 the object whose rotation you want to animate
Transform AnimateRotationCenter
 the object around which to rotate AnimateRotationTarget
float AnimateRotationDuration = 0.2f
 the duration of the transition
float RemapCurveZero = 0f
 the value to remap the curve's 0 value to
float RemapCurveOne = 180f
 the value to remap the curve's 1 value to
bool AnimateX = false
 if this is true, should animate movement on the X axis
AnimationCurve AnimateRotationX = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0))
 how the x part of the movement should animate over time, in degrees
bool AnimateY = true
 if this is true, should animate movement on the Y axis
AnimationCurve AnimateRotationY = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0))
 how the y part of the rotation should animate over time, in degrees
bool AnimateZ = false
 if this is true, should animate movement on the Z axis
AnimationCurve AnimateRotationZ = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0))
 how the z part of the rotation should animate over time, in degrees
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 DetermineRotationOnPlay = false
 if this is true, initial and destination rotations will be recomputed on every play

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 rotation.
virtual void GetInitialPosition ()
 Stores initial rotation for future use.
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On play, we trigger our rotation animation.
virtual void ClearCoroutine ()
virtual IEnumerator AnimateRotation (Transform targetTransform, Vector3 vector, float duration, AnimationCurve curveX, AnimationCurve curveY, AnimationCurve curveZ, float remapZero, float remapOne)
 A coroutine used to compute the rotation over time.
virtual void ApplyRotation (Transform targetTransform, float remapZero, float remapOne, AnimationCurve curveX, AnimationCurve curveY, AnimationCurve curveZ, float percent)
 Computes and applies the rotation to the object.
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On stop, we interrupt movement if it was active.
override void CustomRestoreInitialValues ()
 On restore, we restore our initial state.

Protected Attributes

Vector3 _initialPosition
Vector3 _rotationAngles
Coroutine _coroutine

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 rotation
override bool HasRandomness [get]

Detailed Description

This feedback will animate the target's position (not its rotation), on an arc around the specified rotation center, for the specified duration (in seconds).

Member Enumeration Documentation

◆ TimeScales

the timescale modes this feedback can operate on

Enumerator
Scaled 
Unscaled 

Member Function Documentation

◆ AnimateRotation()

virtual IEnumerator MoreMountains.Feedbacks.MMF_RotatePositionAround.AnimateRotation ( Transform targetTransform,
Vector3 vector,
float duration,
AnimationCurve curveX,
AnimationCurve curveY,
AnimationCurve curveZ,
float remapZero,
float remapOne )
protectedvirtual

A coroutine used to compute the rotation over time.

Parameters
targetTransform
vector
duration
curveX
curveY
curveZ
multiplier
Returns

◆ ApplyRotation()

virtual void MoreMountains.Feedbacks.MMF_RotatePositionAround.ApplyRotation ( Transform targetTransform,
float remapZero,
float remapOne,
AnimationCurve curveX,
AnimationCurve curveY,
AnimationCurve curveZ,
float percent )
protectedvirtual

Computes and applies the rotation to the object.

Parameters
targetTransform
multiplier
curveX
curveY
curveZ
percent

◆ AutomateTargetAcquisition()

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

◆ ClearCoroutine()

virtual void MoreMountains.Feedbacks.MMF_RotatePositionAround.ClearCoroutine ( )
protectedvirtual

◆ CustomInitialization()

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

On init we store our initial rotation.

Parameters
owner

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomPlayFeedback()

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

On play, we trigger our rotation animation.

Parameters
position
feedbacksIntensity

◆ CustomRestoreInitialValues()

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

On restore, we restore our initial state.

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomStopFeedback()

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

◆ GetInitialPosition()

virtual void MoreMountains.Feedbacks.MMF_RotatePositionAround.GetInitialPosition ( )
protectedvirtual

Stores initial rotation for future use.

◆ OnDisable()

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

On disable we reset our coroutine.

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

Member Data Documentation

◆ _coroutine

Coroutine MoreMountains.Feedbacks.MMF_RotatePositionAround._coroutine
protected

◆ _initialPosition

Vector3 MoreMountains.Feedbacks.MMF_RotatePositionAround._initialPosition
protected

◆ _rotationAngles

Vector3 MoreMountains.Feedbacks.MMF_RotatePositionAround._rotationAngles
protected

◆ AllowAdditivePlays

bool MoreMountains.Feedbacks.MMF_RotatePositionAround.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

◆ AnimateRotationCenter

Transform MoreMountains.Feedbacks.MMF_RotatePositionAround.AnimateRotationCenter

the object around which to rotate AnimateRotationTarget

◆ AnimateRotationDuration

float MoreMountains.Feedbacks.MMF_RotatePositionAround.AnimateRotationDuration = 0.2f

the duration of the transition

◆ AnimateRotationTarget

Transform MoreMountains.Feedbacks.MMF_RotatePositionAround.AnimateRotationTarget

the object whose rotation you want to animate

◆ AnimateRotationX

AnimationCurve MoreMountains.Feedbacks.MMF_RotatePositionAround.AnimateRotationX = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0))

how the x part of the movement should animate over time, in degrees

◆ AnimateRotationY

AnimationCurve MoreMountains.Feedbacks.MMF_RotatePositionAround.AnimateRotationY = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0))

how the y part of the rotation should animate over time, in degrees

◆ AnimateRotationZ

AnimationCurve MoreMountains.Feedbacks.MMF_RotatePositionAround.AnimateRotationZ = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0))

how the z part of the rotation should animate over time, in degrees

◆ AnimateX

bool MoreMountains.Feedbacks.MMF_RotatePositionAround.AnimateX = false

if this is true, should animate movement on the X axis

◆ AnimateY

bool MoreMountains.Feedbacks.MMF_RotatePositionAround.AnimateY = true

if this is true, should animate movement on the Y axis

◆ AnimateZ

bool MoreMountains.Feedbacks.MMF_RotatePositionAround.AnimateZ = false

if this is true, should animate movement on the Z axis

◆ DetermineRotationOnPlay

bool MoreMountains.Feedbacks.MMF_RotatePositionAround.DetermineRotationOnPlay = false

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

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_RotatePositionAround.FeedbackTypeAuthorized = true
static

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

◆ RemapCurveOne

float MoreMountains.Feedbacks.MMF_RotatePositionAround.RemapCurveOne = 180f

the value to remap the curve's 1 value to

◆ RemapCurveZero

float MoreMountains.Feedbacks.MMF_RotatePositionAround.RemapCurveZero = 0f

the value to remap the curve's 0 value to

Property Documentation

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_RotatePositionAround.FeedbackDuration
getset

the duration of this feedback is the duration of the rotation

◆ HasAutomatedTargetAcquisition

override bool MoreMountains.Feedbacks.MMF_RotatePositionAround.HasAutomatedTargetAcquisition
get

sets the inspector color for this feedback

◆ HasRandomness

override bool MoreMountains.Feedbacks.MMF_RotatePositionAround.HasRandomness
get

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