Table of Contents

Class AnimationUtility.Wave

Namespace
TMPEffects.TMPAnimations
Assembly
TMPEffects.dll

A wave. Allows you to easily create periodic animations. You should take a look at the online documentation for this one: https://tmpeffects.luca3317.dev/docs/tmpanimator_animationutility_wave.html

[Serializable]
public class AnimationUtility.Wave : AnimationUtility.WaveBase, ISerializationCallbackReceiver
Inheritance
AnimationUtility.Wave
Implements
ISerializationCallbackReceiver
Inherited Members

Constructors

Wave()

public Wave()

Wave(AnimationCurve, AnimationCurve, float, float, float, float)

public Wave(AnimationCurve upwardCurve, AnimationCurve downwardCurve, float upPeriod, float downPeriod, float amplitude, float uniformity = 1)

Parameters

upwardCurve AnimationCurve
downwardCurve AnimationCurve
upPeriod float
downPeriod float
amplitude float
uniformity float

Wave(AnimationCurve, AnimationCurve, float, float, float, float, float, float)

public Wave(AnimationCurve upwardCurve, AnimationCurve downwardCurve, float upPeriod, float downPeriod, float amplitude, float crestWait, float troughWait, float uniformity = 1)

Parameters

upwardCurve AnimationCurve
downwardCurve AnimationCurve
upPeriod float
downPeriod float
amplitude float
crestWait float
troughWait float
uniformity float

Properties

CrestWait

How long to stay at the crest of the wave.

public float CrestWait { get; set; }

Property Value

float

DownwardCurve

The downward curve of the wave.

public AnimationCurve DownwardCurve { get; set; }

Property Value

AnimationCurve

TroughWait

How long to stay at the trough of the wave.

public float TroughWait { get; set; }

Property Value

float

Uniformity

The uniformity of the wave.
Defines how much the offset passed in when evaluating the wave is considered.
A visual representation of this can be found in the online documentation:
https://tmpeffects.luca3317.dev/docs/tmpanimator_animationutility_wave.html

public float Uniformity { get; set; }

Property Value

float

UpwardCurve

The upward curve of the wave.

public AnimationCurve UpwardCurve { get; set; }

Property Value

AnimationCurve

Methods

Evaluate(float, float, bool)

Evaluate the wave.
This will automatically choose the correct way to interpret the wave.

public (float, int) Evaluate(float time, float offset, bool realtimeWait = true)

Parameters

time float

The time value.

offset float

The offset. Affected by Uniformity.

realtimeWait bool

Whether to use real time (i.e. whether to use Period or EffectivePeriod).

Returns

(float, int)

Item1: The value of the wave at the given time and offset.
Item2: Whether youre currently travelling up the wave (=1) or down the wave (=-1).

EvaluateAsInvertedPulse(float, float, bool)

Evaluate the wave as an inverted pulse explicitly, ignoring the TroughWait.

public (float, int) EvaluateAsInvertedPulse(float time, float offset, bool realTimeWait = true)

Parameters

time float

The time value.

offset float

The offset. Affected by Uniformity.

realTimeWait bool

Whether to use real time (i.e. whether to use Period or EffectivePeriod).

Returns

(float, int)

Item1: The value of the wave at the given time and offset.
Item2: Whether youre currently travelling up the wave (=1) or down the wave (=-1).

Exceptions

Exception

EvaluateAsOneDirectionalPulse(float, float, bool)

Evaluate the wave as a one-directional pulse explicitly.

public (float, int) EvaluateAsOneDirectionalPulse(float time, float offset, bool realTimeWait = true)

Parameters

time float

The time value.

offset float

The offset. Affected by Uniformity.

realTimeWait bool

Whether to use real time (i.e. whether to use Period or EffectivePeriod).

Returns

(float, int)

Item1: The value of the wave at the given time and offset.
Item2: Whether youre currently travelling up the wave (=1) or down the wave (=-1).

Exceptions

Exception

EvaluateAsPulse(float, float, bool)

Evaluate the wave as a pulse explicitly, ignoring the CrestWait.

public (float, int) EvaluateAsPulse(float time, float offset, bool realTimeWait = true)

Parameters

time float

The time value.

offset float

The offset. Affected by Uniformity.

realTimeWait bool

Whether to use real time (i.e. whether to use Period or EffectivePeriod).

Returns

(float, int)

Item1: The value of the wave at the given time and offset.
Item2: Whether youre currently travelling up the wave (=1) or down the wave (=-1).

Exceptions

Exception

EvaluateAsWave(float, float)

Evaluate the wave as a normal wave explicitly, ignoring both TroughWait and CrestWait.

public (float, int) EvaluateAsWave(float time, float offset)

Parameters

time float

The time value.

offset float

The offset. Affected by Uniformity.

Returns

(float, int)

Item1: The value of the wave at the given time and offset.
Item2: Whether youre currently travelling up the wave (=1) or down the wave (=-1).

Exceptions

Exception

OnAfterDeserialize()

Implement this method to receive a callback after Unity deserializes your object.

public override void OnAfterDeserialize()

OnBeforeSerialize()

Implement this method to receive a callback before Unity serializes your object.

public override void OnBeforeSerialize()

PassedExtrema(float, float, float, bool, PulseExtrema)

Check whether an extrema was passed between (time - deltaTime) and time.
This will automatically choose the correct way to interpret the wave.

public int PassedExtrema(float time, float deltaTime, float offset, bool realtimeWait = true, AnimationUtility.Wave.PulseExtrema extrema = PulseExtrema.Early)

Parameters

time float

The time value.

deltaTime float

The delta time value.

offset float

The offset. Affected by Uniformity.

realtimeWait bool

Whether to use real time (i.e. whether to use Period or EffectivePeriod).

extrema AnimationUtility.Wave.PulseExtrema

If the wave has a CrestWait or TroughWait, this parameter defines whether an extremum is passed once the wait time begins, or once it ends.

Returns

int

1 if a maximum was passed, -1 if a minimum was passed, 0 if no extremum was passed.

Exceptions

Exception

PassedInvertedPulseExtrema(float, float, float, bool, PulseExtrema)

Check whether an extrema was passed between (time - deltaTime) and time.
Explicitly interpret the wave as an inverted pulse, ignoring the TroughWait.

public int PassedInvertedPulseExtrema(float time, float deltaTime, float offset, bool realtimeWait = true, AnimationUtility.Wave.PulseExtrema extrema = PulseExtrema.Early)

Parameters

time float

The time value.

deltaTime float

The delta time value.

offset float

The offset. Affected by Uniformity.

realtimeWait bool

Whether to use real time (i.e. whether to use Period or EffectivePeriod).

extrema AnimationUtility.Wave.PulseExtrema

If the wave has a CrestWait or TroughWait, this parameter defines whether an extremum is passed once the wait time begins, or once it ends.

Returns

int

1 if a maximum was passed, -1 if a minimum was passed, 0 if no extremum was passed.

Exceptions

Exception

PassedOneDirectionalPulseExtrema(float, float, float, bool, PulseExtrema)

Check whether an extrema was passed between (time - deltaTime) and time. Explicitly interpret the wave as a one-directional pulse.

public int PassedOneDirectionalPulseExtrema(float time, float deltaTime, float offset, bool realtimeWait = true, AnimationUtility.Wave.PulseExtrema extrema = PulseExtrema.Early)

Parameters

time float

The time value.

deltaTime float

The delta time value.

offset float

The offset. Affected by Uniformity.

realtimeWait bool

Whether to use real time (i.e. whether to use Period or EffectivePeriod).

extrema AnimationUtility.Wave.PulseExtrema

If the wave has a CrestWait or TroughWait, this parameter defines whether an extremum is passed once the wait time begins, or once it ends.

Returns

int

1 if a maximum was passed, -1 if a minimum was passed, 0 if no extremum was passed.

Exceptions

Exception

PassedPulseExtrema(float, float, float, bool, PulseExtrema)

Check whether an extrema was passed between (time - deltaTime) and time.
Explicitly interpret the wave as a pulse, ignoring the CrestWait.

public int PassedPulseExtrema(float time, float deltaTime, float offset, bool realtimeWait = true, AnimationUtility.Wave.PulseExtrema extrema = PulseExtrema.Early)

Parameters

time float

The time value.

deltaTime float

The delta time value.

offset float

The offset. Affected by Uniformity.

realtimeWait bool

Whether to use real time (i.e. whether to use Period or EffectivePeriod).

extrema AnimationUtility.Wave.PulseExtrema

If the wave has a CrestWait or TroughWait, this parameter defines whether an extremum is passed once the wait time begins, or once it ends.

Returns

int

1 if a maximum was passed, -1 if a minimum was passed, 0 if no extremum was passed.

Exceptions

Exception

PassedWaveExtrema(float, float, float)

Check whether an extrema was passed between (time - deltaTime) and time.
Explicitly interpret the wave as a normal wave, ignoring both CrestWait and TroughWait.

public int PassedWaveExtrema(float time, float deltaTime, float offset)

Parameters

time float

The time value.

deltaTime float

The delta time value.

offset float

The offset. Affected by Uniformity.

Returns

int

1 if a maximum was passed, -1 if a minimum was passed, 0 if no extremum was passed.

Exceptions

Exception