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

# Class sfNewPrefabWatcher

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

Detects and invokes an event for new prefabs created in Unity. Does not detect new prefab files written externally.

```csharp
public class sfNewPrefabWatcher : AssetModificationProcessor
```

#### Inheritance

object ← AssetModificationProcessor ← [sfNewPrefabWatcher](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnewprefabwatcher.md)

## Methods

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

Gets the singleton instance.

```csharp
public static sfNewPrefabWatcher Get()
```

#### Returns

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

Singleton instance

### OnNewPrefab <a href="#ks_scenefusion_client_unity_editor_sfnewprefabwatcher_onnewprefab" id="ks_scenefusion_client_unity_editor_sfnewprefabwatcher_onnewprefab"></a>

Invoked when a new prefab is created in Unity. Not invoked for new prefab files written externally.

```csharp
public event sfNewPrefabWatcher.NewPrefabHandler OnNewPrefab
```

#### Event Type

[sfNewPrefabWatcher](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnewprefabwatcher.md).[NewPrefabHandler](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfnewprefabwatcher/ks.scenefusion.client.unity.editor.sfnewprefabwatcher.newprefabhandler.md)
