Class AnimationCurveExtensions
Extension methods for AnimationCurve manipulation and processing.
Namespace: NWH.Common.Utility
Assembly: NWH.Common.dll
Syntax
public static class AnimationCurveExtensions
Methods
| Edit this page View SourceGenerateCurveArray(AnimationCurve, int)
Samples an AnimationCurve at regular intervals and returns the values as an array. Useful for pre-calculating curve values for performance-critical code.
Declaration
public static float[] GenerateCurveArray(this AnimationCurve self, int resolution = 256)
Parameters
| Type | Name | Description |
|---|---|---|
| AnimationCurve | self | The curve to sample. |
| int | resolution | Number of samples to take. Higher values provide more precision. |
Returns
| Type | Description |
|---|---|
| float[] | Array of sampled values from 0 to 1. |
MakeSmooth(AnimationCurve)
Smooths out a scripting-generated AnimationCurve by calculating appropriate tangents. Creates smooth transitions between keyframes.
Declaration
public static AnimationCurve MakeSmooth(this AnimationCurve inCurve)
Parameters
| Type | Name | Description |
|---|---|---|
| AnimationCurve | inCurve | The curve to smooth. |
Returns
| Type | Description |
|---|---|
| AnimationCurve | A new smoothed AnimationCurve. |