# UnsafeAnimationCurve

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

Namespace: MeatMotion.Collections

Assembly: MeatMotion

```csharp
public unsafe struct UnsafeAnimationCurve : IDisposable
```

[Runtime/Collections/NativeAnimationCurve.cs · L49](../../source/Runtime/Collections/NativeAnimationCurve.cs.html#L49)

## IsCreated

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

```csharp
public readonly bool IsCreated { get; }
```

[Runtime/Collections/NativeAnimationCurve.cs · L53](../../source/Runtime/Collections/NativeAnimationCurve.cs.html#L53)

## UnsafeAnimationCurve

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

```csharp
public UnsafeAnimationCurve(AllocatorManager.AllocatorHandle allocator)
```

引数

- `allocator` (`AllocatorManager.AllocatorHandle`) ネイティブ領域に使用するアロケーター。

[Runtime/Collections/NativeAnimationCurve.cs · L55](../../source/Runtime/Collections/NativeAnimationCurve.cs.html#L55)

```csharp
public UnsafeAnimationCurve(AnimationCurve animationCurve, AllocatorManager.AllocatorHandle allocator)
```

引数

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

[Runtime/Collections/NativeAnimationCurve.cs · L61](../../source/Runtime/Collections/NativeAnimationCurve.cs.html#L61)

## CopyFrom

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

```csharp
public void CopyFrom(AnimationCurve animationCurve)
```

引数

- `animationCurve` (`AnimationCurve`) カーブのキーと前後のWrapModeを含むUnityのAnimationCurve。

[Runtime/Collections/NativeAnimationCurve.cs · L69](../../source/Runtime/Collections/NativeAnimationCurve.cs.html#L69)

```csharp
public void CopyFrom(in UnsafeAnimationCurve animationCurve)
```

引数

- `animationCurve` (`in UnsafeAnimationCurve`) カーブのキーと前後のWrapModeを含むUnityのAnimationCurve。

[Runtime/Collections/NativeAnimationCurve.cs · L79](../../source/Runtime/Collections/NativeAnimationCurve.cs.html#L79)

## Evaluate

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

```csharp
public float Evaluate(float time)
```

引数と戻り値

- `time` (`float`) カーブを評価する時刻。
- 戻り値: `float`

[Runtime/Collections/NativeAnimationCurve.cs · L86](../../source/Runtime/Collections/NativeAnimationCurve.cs.html#L86)

## Dispose

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

```csharp
public void Dispose()
```

[Runtime/Collections/NativeAnimationCurve.cs · L87](../../source/Runtime/Collections/NativeAnimationCurve.cs.html#L87)
