Skip to content

AnimationCurveUtility

Namespace: SideXP.Core

public static class AnimationCurveUtility

Miscellaneous functions for working with AnimationCurve instances.

Fields

DefaultKeyframe

public static readonly Keyframe DefaultKeyframe

Default Keyframe value.

Properties

Linear

public static AnimationCurve Linear

Creates an AnimationCurve with linear easing.

EaseIn

public static AnimationCurve EaseIn

Creates an AnimationCurve with in easing.

EaseOut

public static AnimationCurve EaseOut

Creates an AnimationCurve with out easing.

EaseInOut

public static AnimationCurve EaseInOut

Creates an AnimationCurve with in-out easing.

Methods

GetFirstKeyframe(AnimationCurve)

public static Keyframe GetFirstKeyframe(AnimationCurve curve)

Gets the first keyframe on X axis of this AnimationCurve.

Parameters

  • curve: The curve to process.

Returns

Returns the found keyframe, or the default one if there's no keyframe on the curve.

GetLastKeyframe(AnimationCurve)

public static Keyframe GetLastKeyframe(AnimationCurve curve)

Gets the last keyframe on X axis of this AnimationCurve.

Parameters

  • curve: The curve to process.

Returns

Returns the found keyframe, or the default one if there's no keyframe on the curve.

GetMinKeyframe(AnimationCurve)

public static Keyframe GetMinKeyframe(AnimationCurve curve)

Gets the lowest keyframe on Y axis of this AnimationCurve.

Parameters

  • curve: The curve to process.

Returns

Returns the found keyframe, or the default one if there's no keyframe on the curve.

GetMaxKeyframe(AnimationCurve)

public static Keyframe GetMaxKeyframe(AnimationCurve curve)

Gets the highest keyframe on Y axis of this AnimationCurve.

Parameters

  • curve: The curve to process.

Returns

Returns the found keyframe, or the default one if there's no keyframe on the curve.

GetMinTime(AnimationCurve)

public static float GetMinTime(AnimationCurve curve)

Gets the minimum time of this AnimationCurve.

Parameters

  • curve: The curve to process.

Returns

Returns the found minimum time, or default keyframe's if there's no keyframe on the curve.

GetMaxTime(AnimationCurve)

public static float GetMaxTime(AnimationCurve curve)

Gets the maximum time of this AnimationCurve.

Parameters

  • curve: The curve to process.

Returns

Returns the found maximum time, or default keyframe's if there's no keyframe on the curve.

GetMinValue(AnimationCurve)

public static float GetMinValue(AnimationCurve curve)

Gets the minimum value of this AnimationCurve.

Parameters

  • curve: The curve to process.

Returns

Returns the found minimum value, or default keyframe's if there's no keyframe on the curve.

GetMaxValue(AnimationCurve)

public static float GetMaxValue(AnimationCurve curve)

Gets the maximum value of this AnimationCurve.

Parameters

  • curve: The curve to process.

Returns

Returns the found maximum value, or default keyframe's if there's no keyframe on the curve.

GetDuration(AnimationCurve)

public static float GetDuration(AnimationCurve curve)

Calculates the duration of an AnimationCurve, using its first and last keyframes on X axis.

Parameters

  • curve: The curve to process.

Returns

Returns the calculated duration of the AnimationCurve. Note that it will return 0 if the AnimationCurve counts less than 2 keyframes.

GetRange(AnimationCurve)

public static float GetRange(AnimationCurve curve)

Calculates the value range of an AnimationCurve, using its lowest and highest keyframes on Y axis.

Parameters

  • curve: The curve to process.

Returns

Returns the calculated value range of the AnimationCurve. Note that it will return 0 if the AnimationCurve counts less than 2 keyframes.

Loop(AnimationCurve)

public static AnimationCurve Loop(AnimationCurve curve)

Makes this AnimationCurve repeat (loop) before its first frame, and after its last frame.

Parameters

  • curve: The curve to process.

Returns

Returns the updated input curve.

PingPong(AnimationCurve)

public static AnimationCurve PingPong(AnimationCurve curve)

Makes this AnimationCurve ping-pong before its first frame, and after its last frame.

Parameters

  • curve: The curve to process.

Returns

Returns the updated input curve.