MeatMotion

UnsafeAnimationCurve

UnsafeListを使ってカーブを保持・評価します。割り当てに使うAllocatorを指定し、利用後にDisposeします。

Namespace
MeatMotion.Collections
Assembly
MeatMotion

メンバー一覧へ

public unsafe struct UnsafeAnimationCurve : IDisposable
NativeAnimationCurve.cs · L49

メンバー

IsCreated

カーブのネイティブ領域が割り当てられているかを返します。

public readonly bool IsCreated { get; }

UnsafeAnimationCurve

指定したAllocatorでカーブを作ります。AnimationCurveを渡す形式では、そのキーとWrapModeをコピーします。

public UnsafeAnimationCurve(AllocatorManager.AllocatorHandle allocator)
引数
allocator
AllocatorManager.AllocatorHandle ネイティブ領域に使用するアロケーター。
public UnsafeAnimationCurve(AnimationCurve animationCurve, AllocatorManager.AllocatorHandle allocator)
引数
animationCurve
AnimationCurve カーブのキーと前後のWrapModeを含むUnityのAnimationCurve。
allocator
AllocatorManager.AllocatorHandle ネイティブ領域に使用するアロケーター。

CopyFrom

既存のカーブデータを渡したAnimationCurveのキーとWrapModeで更新します。

public void CopyFrom(AnimationCurve animationCurve)
引数
animationCurve
AnimationCurve カーブのキーと前後のWrapModeを含むUnityのAnimationCurve。
public void CopyFrom(in UnsafeAnimationCurve animationCurve)
引数
animationCurve
in UnsafeAnimationCurve カーブのキーと前後のWrapModeを含むUnityのAnimationCurve。

Evaluate

指定した時刻でキーとWrapModeを評価してfloatを返します。

public float Evaluate(float time)
引数と戻り値
time
float カーブを評価する時刻。
戻り値
float

Dispose

カーブ用に確保したネイティブ領域を解放します。