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

This feedback will animate the scale of the target object over time when played. More...

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

Public Types

enum  Modes { Absolute , Additive , ToDestination }
 the possible modes this feedback can operate on More...
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

Modes Mode = Modes.Absolute
Transform AnimateScaleTarget
 the object to animate
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 AnimateScaleDuration = 0.2f
 the duration of the animation
float AnimatePositionSpeed = 1f
 in speed mode, the speed at which we should animate the position
float RemapCurveZero = 1f
 the value to remap the curve's 0 value to
float RemapCurveOne = 2f
 the value to remap the curve's 1 value to
float Offset = 0f
 how much should be added to the curve
bool AnimateX = true
 if this is true, should animate the X scale value
MMTweenType AnimateScaleTweenX = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1.5f), new Keyframe(1, 0)), "AnimateX")
 the x scale animation definition
bool AnimateY = true
 if this is true, should animate the Y scale value
MMTweenType AnimateScaleTweenY = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1.5f), new Keyframe(1, 0)), "AnimateY")
 the y scale animation definition
bool AnimateZ = true
 if this is true, should animate the z scale value
MMTweenType AnimateScaleTweenZ = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1.5f), new Keyframe(1, 0)), "AnimateZ")
 the z scale animation definition
bool UniformScaling = false
 if this is true, the AnimateX curve only will be used, and applied to all axis
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 DetermineScaleOnPlay = false
 if this is true, initial and destination scales will be recomputed on every play
Vector3 DestinationScale = new Vector3(0.5f, 0.5f, 0.5f)
 the scale to reach when in ToDestination mode
AnimationCurve AnimateScaleX = null
 [DEPRECATED] the x scale animation definition
AnimationCurve AnimateScaleY = null
 [DEPRECATED] the y scale animation definition
AnimationCurve AnimateScaleZ = null
 [DEPRECATED] the z scale animation definition

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 scale.
virtual void GetInitialScale ()
 Stores initial scale for future use.
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, triggers the scale animation.
virtual IEnumerator ScaleToDestination ()
 An internal coroutine used to scale the target to its destination scale.
virtual IEnumerator AnimateScale (Transform targetTransform, Vector3 vector, float duration, MMTweenType curveX, MMTweenType curveY, MMTweenType curveZ, float remapCurveZero=0f, float remapCurveOne=1f)
 An internal coroutine used to animate the scale over time.
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 _initialScale
Vector3 _newScale
Coroutine _coroutine

Properties

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

Detailed Description

This feedback will animate the scale of the target object over time when played.

Member Enumeration Documentation

◆ Modes

the possible modes this feedback can operate on

Enumerator
Absolute 
Additive 
ToDestination 

◆ MovementModes

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

Enumerator
Duration 
Speed 

Member Function Documentation

◆ AnimateScale()

virtual IEnumerator MoreMountains.Feedbacks.MMF_Scale.AnimateScale ( Transform targetTransform,
Vector3 vector,
float duration,
MMTweenType curveX,
MMTweenType curveY,
MMTweenType curveZ,
float remapCurveZero = 0f,
float remapCurveOne = 1f )
protectedvirtual

An internal coroutine used to animate the scale over time.

Parameters
targetTransform
vector
duration
curveX
curveY
curveZ
multiplier
Returns

◆ AutomateTargetAcquisition()

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

◆ CustomInitialization()

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

On init we store our initial scale.

Parameters
owner

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomPlayFeedback()

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

On Play, triggers the scale animation.

Parameters
position
feedbacksIntensity

◆ CustomRestoreInitialValues()

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

On restore, we restore our initial state.

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomStopFeedback()

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

◆ GetInitialScale()

virtual void MoreMountains.Feedbacks.MMF_Scale.GetInitialScale ( )
protectedvirtual

Stores initial scale for future use.

◆ HandleSpeedMode()

virtual float MoreMountains.Feedbacks.MMF_Scale.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

◆ OnDisable()

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

On disable we reset our coroutine.

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ OnValidate()

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

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

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ ScaleToDestination()

virtual IEnumerator MoreMountains.Feedbacks.MMF_Scale.ScaleToDestination ( )
protectedvirtual

An internal coroutine used to scale the target to its destination scale.

Returns

Member Data Documentation

◆ _coroutine

Coroutine MoreMountains.Feedbacks.MMF_Scale._coroutine
protected

◆ _initialScale

Vector3 MoreMountains.Feedbacks.MMF_Scale._initialScale
protected

◆ _newScale

Vector3 MoreMountains.Feedbacks.MMF_Scale._newScale
protected

◆ AllowAdditivePlays

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

◆ AnimatePositionSpeed

float MoreMountains.Feedbacks.MMF_Scale.AnimatePositionSpeed = 1f

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

◆ AnimateScaleDuration

float MoreMountains.Feedbacks.MMF_Scale.AnimateScaleDuration = 0.2f

the duration of the animation

◆ AnimateScaleTarget

Transform MoreMountains.Feedbacks.MMF_Scale.AnimateScaleTarget

the object to animate

◆ AnimateScaleTweenX

MMTweenType MoreMountains.Feedbacks.MMF_Scale.AnimateScaleTweenX = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1.5f), new Keyframe(1, 0)), "AnimateX")

the x scale animation definition

◆ AnimateScaleTweenY

MMTweenType MoreMountains.Feedbacks.MMF_Scale.AnimateScaleTweenY = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1.5f), new Keyframe(1, 0)), "AnimateY")

the y scale animation definition

◆ AnimateScaleTweenZ

MMTweenType MoreMountains.Feedbacks.MMF_Scale.AnimateScaleTweenZ = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1.5f), new Keyframe(1, 0)), "AnimateZ")

the z scale animation definition

◆ AnimateScaleX

AnimationCurve MoreMountains.Feedbacks.MMF_Scale.AnimateScaleX = null

[DEPRECATED] the x scale animation definition

◆ AnimateScaleY

AnimationCurve MoreMountains.Feedbacks.MMF_Scale.AnimateScaleY = null

[DEPRECATED] the y scale animation definition

◆ AnimateScaleZ

AnimationCurve MoreMountains.Feedbacks.MMF_Scale.AnimateScaleZ = null

[DEPRECATED] the z scale animation definition

◆ AnimateX

bool MoreMountains.Feedbacks.MMF_Scale.AnimateX = true

if this is true, should animate the X scale value

◆ AnimateY

bool MoreMountains.Feedbacks.MMF_Scale.AnimateY = true

if this is true, should animate the Y scale value

◆ AnimateZ

bool MoreMountains.Feedbacks.MMF_Scale.AnimateZ = true

if this is true, should animate the z scale value

◆ DestinationScale

Vector3 MoreMountains.Feedbacks.MMF_Scale.DestinationScale = new Vector3(0.5f, 0.5f, 0.5f)

the scale to reach when in ToDestination mode

◆ DetermineScaleOnPlay

bool MoreMountains.Feedbacks.MMF_Scale.DetermineScaleOnPlay = false

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

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_Scale.FeedbackTypeAuthorized = true
static

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

◆ Mode

Modes MoreMountains.Feedbacks.MMF_Scale.Mode = Modes.Absolute

the mode this feedback should operate on Absolute : follows the curve Additive : adds to the current scale of the target ToDestination : sets the scale to the destination target, whatever the current scale is

◆ MovementMode

MovementModes MoreMountains.Feedbacks.MMF_Scale.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

◆ Offset

float MoreMountains.Feedbacks.MMF_Scale.Offset = 0f

how much should be added to the curve

◆ RemapCurveOne

float MoreMountains.Feedbacks.MMF_Scale.RemapCurveOne = 2f

the value to remap the curve's 1 value to

◆ RemapCurveZero

float MoreMountains.Feedbacks.MMF_Scale.RemapCurveZero = 1f

the value to remap the curve's 0 value to

◆ UniformScaling

bool MoreMountains.Feedbacks.MMF_Scale.UniformScaling = false

if this is true, the AnimateX curve only will be used, and applied to all axis

Property Documentation

◆ CanForceInitialValue

override bool MoreMountains.Feedbacks.MMF_Scale.CanForceInitialValue
get

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_Scale.FeedbackDuration
getset

the duration of this feedback is the duration of the scale animation

◆ HasAutomatedTargetAcquisition

override bool MoreMountains.Feedbacks.MMF_Scale.HasAutomatedTargetAcquisition
get

sets the inspector color for this feedback

◆ HasRandomness

override bool MoreMountains.Feedbacks.MMF_Scale.HasRandomness
get

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