Skip to content

AnimationCurveExtensions

Namespace: SideXP.Core

public static class AnimationCurveExtensions

Extension functions for AnimationCurve instances.

Fields

DefaultKeyframe

public static readonly Keyframe DefaultKeyframe

Default Keyframe value.

Methods

GetDuration(AnimationCurve)

public static float GetDuration(AnimationCurve curve)

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

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.

Returns

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

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.

GetMinKeyframe(AnimationCurve)

public static Keyframe GetMinKeyframe(AnimationCurve curve)

Gets the lowest keyframe on Y axis of this AnimationCurve.

GetMaxKeyframe(AnimationCurve)

public static Keyframe GetMaxKeyframe(AnimationCurve curve)

Gets the highest keyframe on Y axis of this AnimationCurve.

GetMinTime(AnimationCurve)

public static float GetMinTime(AnimationCurve curve)

Gets the minimum time of this AnimationCurve.

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.

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.

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.

Returns

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

Loop(AnimationCurve)

public static AnimationCurve Loop(AnimationCurve curve)

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

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.

Returns

Returns the updated input curve.