# MotionDispatcher

Reserve or clear automatic motion storage and select the handler for unhandled exceptions.

Namespace: MeatMotion

Assembly: MeatMotion

```csharp
public static class MotionDispatcher
```

[Runtime/Scheduling/MotionDispatcher.cs · L9](../../../source/Runtime/Scheduling/MotionDispatcher.cs.html#L9)

## RegisterUnhandledExceptionHandler

Set the handler for unhandled errors. The default is Debug.LogException.

```csharp
public static void RegisterUnhandledExceptionHandler(Action<Exception> unhandledExceptionHandler)
```

Parameters

- `unhandledExceptionHandler` (`Action<Exception>`) Callback receiving unhandled exceptions.

[Runtime/Scheduling/MotionDispatcher.cs · L12](../../../source/Runtime/Scheduling/MotionDispatcher.cs.html#L12)

## GetUnhandledExceptionHandler

Get the currently registered unhandled-exception handler.

```csharp
public static Action<Exception> GetUnhandledExceptionHandler()
```

Return value

- Returns: `Action<Exception>`

[Runtime/Scheduling/MotionDispatcher.cs · L13](../../../source/Runtime/Scheduling/MotionDispatcher.cs.html#L13)

## Clear

Clear motions from automatic update storage.

```csharp
public static void Clear()
```

[Runtime/Scheduling/MotionDispatcher.cs · L15](../../../source/Runtime/Scheduling/MotionDispatcher.cs.html#L15)

## EnsureStorageCapacity

Reserve automatic update storage for this combination of types.

```csharp
public static void EnsureStorageCapacity<TValue, TOptions, TAdapter>(int capacity)
    where TValue : unmanaged
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<TValue, TOptions>
```

Parameters

- `capacity` (`int`) Number of entries to reserve.

[Runtime/Scheduling/MotionDispatcher.cs · L16](../../../source/Runtime/Scheduling/MotionDispatcher.cs.html#L16)
