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

# Class sfSelectionWatcher

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

Checks for uobject selection changes and invokes OnSelect and OnDeselect events.

```csharp
public class sfSelectionWatcher
```

#### Inheritance

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

## Methods

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

```csharp
public static sfSelectionWatcher Get()
```

#### Returns

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

singleton instance

### IsSelected(Object) <a href="#ks_scenefusion_client_unity_editor_sfselectionwatcher_isselected_unityengine_object" id="ks_scenefusion_client_unity_editor_sfselectionwatcher_isselected_unityengine_object"></a>

Checks if a uobject is selected. If the uobject is a component, checks if the component's game object is selected.

```csharp
public bool IsSelected(Object uobj)
```

#### Parameters

`uobj` Object

#### Returns

bool

true if the uobject is selected.

### Start() <a href="#ks_scenefusion_client_unity_editor_sfselectionwatcher_start" id="ks_scenefusion_client_unity_editor_sfselectionwatcher_start"></a>

Starts checking for selection changes.

```csharp
public void Start()
```

### Stop() <a href="#ks_scenefusion_client_unity_editor_sfselectionwatcher_stop" id="ks_scenefusion_client_unity_editor_sfselectionwatcher_stop"></a>

Stops checking for selection changes.

```csharp
public void Stop()
```

### OnDeselect <a href="#ks_scenefusion_client_unity_editor_sfselectionwatcher_ondeselect" id="ks_scenefusion_client_unity_editor_sfselectionwatcher_ondeselect"></a>

Invoked when a uobject is deselected or a selected uobject is deleted.

```csharp
public event sfSelectionWatcher.DeselectionHandler OnDeselect
```

#### Event Type

[sfSelectionWatcher](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfselectionwatcher.md).[DeselectionHandler](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfselectionwatcher/ks.scenefusion.client.unity.editor.sfselectionwatcher.deselectionhandler.md)

### OnSelect <a href="#ks_scenefusion_client_unity_editor_sfselectionwatcher_onselect" id="ks_scenefusion_client_unity_editor_sfselectionwatcher_onselect"></a>

Invoked when a uobject is selected.

```csharp
public event sfSelectionWatcher.SelectionHandler OnSelect
```

#### Event Type

[sfSelectionWatcher](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfselectionwatcher.md).[SelectionHandler](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfselectionwatcher/ks.scenefusion.client.unity.editor.sfselectionwatcher.selectionhandler.md)
