> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/scene-fusion/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sftypeeventmap-1.md).

# Class sfTypeEventMap\<T>

Namespace: [KS.SceneFusion.Client.Unity.Editor](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor.md)\
Assembly: KSUnity-Source.dll

Maps types to event handlers of delegate type T.

```csharp
public class sfTypeEventMap<T> : sfEventMap<Type, T> where T : class
```

#### Type Parameters

`T`

#### Inheritance

object ← [sfEventMap\<Type, T>](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfeventmap-2.md) ← [sfTypeEventMap\<T>](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sftypeeventmap-1.md)

#### Inherited Members

[sfEventMap\<Type, T>.m\_map](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfeventmap-2.md#ks_scenefusion_client_unity_editor_sfeventmap_2_m_map), [sfEventMap\<Type, T>.this\[Type\]](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfeventmap-2.md#ks_scenefusion_client_unity_editor_sfeventmap_2_item__0), [sfEventMap\<Type, T>.GetHandlers(Type)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfeventmap-2.md#ks_scenefusion_client_unity_editor_sfeventmap_2_gethandlers__0)

## Methods

### Add\<Key>(T) <a href="#ks_scenefusion_client_unity_editor_sftypeeventmap_1_add__1__0" id="ks_scenefusion_client_unity_editor_sftypeeventmap_1_add__1__0"></a>

Adds a handler for a type Key.

```csharp
public void Add<Key>(T handler)
```

#### Parameters

`handler` T

handler to add.

#### Type Parameters

`Key`

### Add(Type, T) <a href="#ks_scenefusion_client_unity_editor_sftypeeventmap_1_add_system_type__0" id="ks_scenefusion_client_unity_editor_sftypeeventmap_1_add_system_type__0"></a>

Adds a handler for a type Key.

```csharp
public void Add(Type type, T handler)
```

#### Parameters

`type` Type

type to add handler for.

`handler` T

handler to add.

### GetHandlers(Type) <a href="#ks_scenefusion_client_unity_editor_sftypeeventmap_1_gethandlers_system_type" id="ks_scenefusion_client_unity_editor_sftypeeventmap_1_gethandlers_system_type"></a>

Gets a delegate that combines all handlers for a type and its ancestors.

```csharp
public override T GetHandlers(Type type)
```

#### Parameters

`type` Type

type to get handlers for.

#### Returns

T

### GetHandlers(Type, bool) <a href="#ks_scenefusion_client_unity_editor_sftypeeventmap_1_gethandlers_system_type_system_boolean" id="ks_scenefusion_client_unity_editor_sftypeeventmap_1_gethandlers_system_type_system_boolean"></a>

Gets a delegate that combines all event handlers for a type.

```csharp
public T GetHandlers(Type type, bool checkInheritance)
```

#### Parameters

`type` Type

type to get handlers for.

`checkInheritance` bool

if true, will also get handlers for ancestor types.

#### Returns

T

delegate for the handlers, or null if the type has no handlers.

### Remove\<Key>(T) <a href="#ks_scenefusion_client_unity_editor_sftypeeventmap_1_remove__1__0" id="ks_scenefusion_client_unity_editor_sftypeeventmap_1_remove__1__0"></a>

Removes a handler for a type Key.

```csharp
public void Remove<Key>(T handler)
```

#### Parameters

`handler` T

handler to remove.

#### Type Parameters

`Key`

### Remove(Type, T) <a href="#ks_scenefusion_client_unity_editor_sftypeeventmap_1_remove_system_type__0" id="ks_scenefusion_client_unity_editor_sftypeeventmap_1_remove_system_type__0"></a>

Removes a handler for a type Key.

```csharp
public void Remove(Type type, T handler)
```

#### Parameters

`type` Type

type to remove handler for.

`handler` T

handler to remove.
