> 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.sfnotificationmanager.md).

# Class sfNotificationManager

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

Manages notifications that are applied to uobjects.

```csharp
public class sfNotificationManager
```

#### Inheritance

object ← [sfNotificationManager](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotificationmanager.md)

## Properties

### Count <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_count" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_count"></a>

Number of notifications

```csharp
public int Count { get; }
```

#### Property Value

int

### HasNotifications <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_hasnotifications" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_hasnotifications"></a>

Do we have any notifications?

```csharp
public bool HasNotifications { get; }
```

#### Property Value

bool

### LastNotificationCategory <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_lastnotificationcategory" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_lastnotificationcategory"></a>

Last notification

```csharp
public sfNotificationCategory LastNotificationCategory { get; }
```

#### Property Value

[sfNotificationCategory](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotificationcategory.md)

## Methods

### Add(sfNotification) <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_add_ks_scenefusion_client_unity_editor_sfno" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_add_ks_scenefusion_client_unity_editor_sfno"></a>

Adds a notification.

```csharp
public void Add(sfNotification notification)
```

#### Parameters

`notification` [sfNotification](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotification.md)

notification to add.

### AddNotificationTo(sfNotification, Object) <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_addnotificationto_ks_scenefusion_client_uni" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_addnotificationto_ks_scenefusion_client_uni"></a>

Adds a notification to a uobject.

```csharp
public int AddNotificationTo(sfNotification notification, Object uobj)
```

#### Parameters

`notification` [sfNotification](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotification.md)

notification to add.

`uobj` Object

uobj to add notification to.

#### Returns

int

number of times the notification was added to the uobject. It must be removed this number of times to fully remove it.

### Clear() <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_clear" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_clear"></a>

Clears all notifications.

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

### Create(sfNotificationCategory, string, params Object\[]) <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_create_ks_scenefusion_client_unity_editor_s" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_create_ks_scenefusion_client_unity_editor_s"></a>

Creates or finds an existing notification and adds uobjects to it.

```csharp
public sfNotification Create(sfNotificationCategory category, string message, params Object[] objects)
```

#### Parameters

`category` [sfNotificationCategory](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotificationcategory.md)

category for the notification.

`message` string

message for the notification.

`objects` Object\[]

objects to add to the notification.

#### Returns

[sfNotification](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotification.md)

notification

### Get() <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_get" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_get"></a>

Singleton instance

```csharp
public static sfNotificationManager Get()
```

#### Returns

[sfNotificationManager](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotificationmanager.md)

### GetEnumerator() <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_getenumerator" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_getenumerator"></a>

```csharp
public IEnumerator<KeyValuePair<sfNotificationCategory, ksLinkedList<sfNotification>>> GetEnumerator()
```

#### Returns

IEnumerator\<KeyValuePair<[sfNotificationCategory](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotificationcategory.md), ksLinkedList<[sfNotification](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotification.md)>>>

enumerator for the notification categories.

### GetNotifications(sfNotificationCategory) <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_getnotifications_ks_scenefusion_client_unit" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_getnotifications_ks_scenefusion_client_unit"></a>

Gets all active notifications for a category.

```csharp
public ksLinkedList<sfNotification> GetNotifications(sfNotificationCategory category)
```

#### Parameters

`category` [sfNotificationCategory](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotificationcategory.md)

category to get notifications for.

#### Returns

ksLinkedList<[sfNotification](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotification.md)>

notifications for the category, or null if the category has no notifications.

### GetNotifications(Object, bool) <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_getnotifications_unityengine_object_system" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_getnotifications_unityengine_object_system"></a>

Gets all active notifications for a uobject.

```csharp
public ksLinkedList<sfNotification> GetNotifications(Object uobj, bool includeComponentNotifications = false)
```

#### Parameters

`uobj` Object

uobj to get notifications for.

`includeComponentNotifications` bool

if true and the uobj is a game object, will also get notifications for the game object's components.

#### Returns

ksLinkedList<[sfNotification](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotification.md)>

notifications for the uobject, or null if the uobject has no notifications.

### Remove(sfNotificationCategory, string, params Object\[]) <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_remove_ks_scenefusion_client_unity_editor_s" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_remove_ks_scenefusion_client_unity_editor_s"></a>

Removes a notification from some uobjects. If this is called with no uobjects or the notification has no uobjects, removes the notification. If a notification was added to a uobject multiple times, it must be removed the same number of times to remove it.

```csharp
public void Remove(sfNotificationCategory category, string message, params Object[] objects)
```

#### Parameters

`category` [sfNotificationCategory](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotificationcategory.md)

category of notification.

`message` string

message of notification.

`objects` Object\[]

objects to remove. Will remove the notification if no objects are provided.

### Remove(sfNotification) <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_remove_ks_scenefusion_client_unity_editor_s" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_remove_ks_scenefusion_client_unity_editor_s"></a>

Removes a notification.

```csharp
public void Remove(sfNotification notification)
```

#### Parameters

`notification` [sfNotification](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotification.md)

notification to remove.

### RemoveNotificationFrom(sfNotification, Object, bool, bool) <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_removenotificationfrom_ks_scenefusion_clien" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_removenotificationfrom_ks_scenefusion_clien"></a>

Removes a notification from a uobject. If a notification was added to a uobject multiple times, it must be removed to same number of times to remove it, unless forceRemove is true.

```csharp
public int RemoveNotificationFrom(sfNotification notification, Object uobj, bool removeIfNoObjects = true, bool forceRemove = false)
```

#### Parameters

`notification` [sfNotification](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotification.md)

notification to remove.

`uobj` Object

uobj to remove notification from.

`removeIfNoObjects` bool

if true, will remove the notification if the notification has no objects.

`forceRemove` bool

if true, will remove the notification from the uobject even if it was added multiple times.

#### Returns

int

number of remaining times the notification was added to the uobject. It must be removed again this number of times to fully remove it. Returns -1 if the notification could not be removed because it wasn't found on the uobject.

### RemoveNotificationsFor(Object) <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_removenotificationsfor_unityengine_object" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_removenotificationsfor_unityengine_object"></a>

Removes all notifications for a uobject.

```csharp
public void RemoveNotificationsFor(Object uobj)
```

#### Parameters

`uobj` Object

uobj to remove notifications for.

### OnChange <a href="#ks_scenefusion_client_unity_editor_sfnotificationmanager_onchange" id="ks_scenefusion_client_unity_editor_sfnotificationmanager_onchange"></a>

Invoked when a notifiction is added or removed, or uobjects are added or removed to a notification.

```csharp
public event sfNotificationManager.ChangeHandler OnChange
```

#### Event Type

[sfNotificationManager](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotificationmanager.md).[ChangeHandler](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnotificationmanager/ks.scenefusion.client.unity.editor.sfnotificationmanager.changehandler.md)
