MeatMotion

UnsafeAnimationCurve

Store curve data in an UnsafeList for evaluation. Choose the allocator and dispose the curve after use.

Namespace
MeatMotion.Collections
Assembly
MeatMotion

Jump to members

public unsafe struct UnsafeAnimationCurve : IDisposable
NativeAnimationCurve.cs · L49

Members

IsCreated

Check whether native storage for the curve has been created.

public readonly bool IsCreated { get; }

UnsafeAnimationCurve

Allocate curve storage. The overload taking an AnimationCurve also copies its keys and wrap modes.

public UnsafeAnimationCurve(AllocatorManager.AllocatorHandle allocator)
Parameters
allocator
AllocatorManager.AllocatorHandle Allocator for native storage.
public UnsafeAnimationCurve(AnimationCurve animationCurve, AllocatorManager.AllocatorHandle allocator)
Parameters
animationCurve
AnimationCurve Unity AnimationCurve with its keys and pre/post wrap modes.
allocator
AllocatorManager.AllocatorHandle Allocator for native storage.

CopyFrom

Replace the stored keys and wrap modes from the supplied AnimationCurve.

public void CopyFrom(AnimationCurve animationCurve)
Parameters
animationCurve
AnimationCurve Unity AnimationCurve with its keys and pre/post wrap modes.
public void CopyFrom(in UnsafeAnimationCurve animationCurve)
Parameters
animationCurve
in UnsafeAnimationCurve Unity AnimationCurve with its keys and pre/post wrap modes.

Evaluate

Evaluate the keys and wrap modes at the supplied time and return a float.

public float Evaluate(float time)
Parameters and return value
time
float Time at which to evaluate the curve.
Returns
float

Dispose

Release the native storage allocated for the curve.