# UnsafeAnimationCurve

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

Namespace: MeatMotion.Collections

Assembly: MeatMotion

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

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

## IsCreated

Check whether native storage for the curve has been created.

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

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

## UnsafeAnimationCurve

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

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

Parameters

- `allocator` (`AllocatorManager.AllocatorHandle`) Allocator for native storage.

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

```csharp
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.

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

## CopyFrom

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

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

Parameters

- `animationCurve` (`AnimationCurve`) Unity AnimationCurve with its keys and pre/post wrap modes.

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

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

Parameters

- `animationCurve` (`in UnsafeAnimationCurve`) Unity AnimationCurve with its keys and pre/post wrap modes.

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

## Evaluate

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

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

Parameters and return value

- `time` (`float`) Time at which to evaluate the curve.
- Returns: `float`

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

## Dispose

Release the native storage allocated for the curve.

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

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