# ManagedMotionData

Stores a stateful setter and lifecycle callbacks. Callers of UpdateUnsafe must supply a delegate matching the stored state types.

Namespace: MeatMotion

Assembly: MeatMotion

```csharp
public struct ManagedMotionData
```

[Runtime/Core/ManagedMotionData.cs · L18](../../../source/Runtime/Core/ManagedMotionData.cs.html#L18)

## CancelOnError

Whether a setter exception cancels the motion.

```csharp
public bool CancelOnError;
```

[Runtime/Core/ManagedMotionData.cs · L21](../../../source/Runtime/Core/ManagedMotionData.cs.html#L21)

## SkipValuesDuringDelay

Whether to suppress writes to the binding during a delay.

```csharp
public bool SkipValuesDuringDelay;
```

[Runtime/Core/ManagedMotionData.cs · L21](../../../source/Runtime/Core/ManagedMotionData.cs.html#L21)

## StateCount

Number of bound state objects passed after the value. Setter dispatch supports zero through three.

```csharp
public byte StateCount;
```

[Runtime/Core/ManagedMotionData.cs · L22](../../../source/Runtime/Core/ManagedMotionData.cs.html#L22)

## State0

First state object after the value argument.

```csharp
public object State0;
```

[Runtime/Core/ManagedMotionData.cs · L23](../../../source/Runtime/Core/ManagedMotionData.cs.html#L23)

## State1

Second bound state argument.

```csharp
public object State1;
```

[Runtime/Core/ManagedMotionData.cs · L23](../../../source/Runtime/Core/ManagedMotionData.cs.html#L23)

## State2

Third bound state argument.

```csharp
public object State2;
```

[Runtime/Core/ManagedMotionData.cs · L23](../../../source/Runtime/Core/ManagedMotionData.cs.html#L23)

## UpdateAction

Delegate applying the interpolated value. Its argument types and arity must match StateCount.

```csharp
public object UpdateAction;
```

[Runtime/Core/ManagedMotionData.cs · L23](../../../source/Runtime/Core/ManagedMotionData.cs.html#L23)

## OnLoopCompleteAction

Callback receiving the completed loop count.

```csharp
public Action<int> OnLoopCompleteAction;
```

[Runtime/Core/ManagedMotionData.cs · L24](../../../source/Runtime/Core/ManagedMotionData.cs.html#L24)

## OnCompleteAction

Delegate invoked on completion.

```csharp
public Action OnCompleteAction;
```

[Runtime/Core/ManagedMotionData.cs · L25](../../../source/Runtime/Core/ManagedMotionData.cs.html#L25)

## OnCancelAction

Delegate invoked on cancellation.

```csharp
public Action OnCancelAction;
```

[Runtime/Core/ManagedMotionData.cs · L25](../../../source/Runtime/Core/ManagedMotionData.cs.html#L25)

## DebugName

Debug label available in the Editor or a Development Build.

```csharp
public string DebugName;
```

Requires MEATMOTION_DEBUG_NAMES

[Runtime/Core/ManagedMotionData.cs · L27](../../../source/Runtime/Core/ManagedMotionData.cs.html#L27)

## UpdateUnsafe

Invoke UpdateAction with the stored number of state arguments. The caller must ensure the delegate and value types agree.

```csharp
public void UpdateUnsafe<TValue>(in TValue value)
    where TValue : unmanaged
```

Parameters

- `value` (`in TValue`) Interpolated value passed to the stateful setter.

[Runtime/Core/ManagedMotionData.cs · L31](../../../source/Runtime/Core/ManagedMotionData.cs.html#L31)

## InvokeOnCancel

Invoke the cancellation callback and report callback exceptions through MotionDispatcher.

```csharp
public readonly void InvokeOnCancel()
```

[Runtime/Core/ManagedMotionData.cs · L49](../../../source/Runtime/Core/ManagedMotionData.cs.html#L49)

## InvokeOnComplete

Invoke the completion callback and report callback exceptions through MotionDispatcher.

```csharp
public readonly void InvokeOnComplete()
```

[Runtime/Core/ManagedMotionData.cs · L50](../../../source/Runtime/Core/ManagedMotionData.cs.html#L50)

## InvokeOnLoopComplete

Notify the callback with the completed loop count and report callback exceptions through MotionDispatcher.

```csharp
public readonly void InvokeOnLoopComplete(int completedLoops)
```

Parameters

- `completedLoops` (`int`) Number of completed loops.

[Runtime/Core/ManagedMotionData.cs · L51](../../../source/Runtime/Core/ManagedMotionData.cs.html#L51)
