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

# Class sfUI

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

Scene Fusion UI class.

```csharp
public class sfUI
```

#### Inheritance

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

## Fields

### DEFAULT\_SCENE\_VIEW\_SIZE <a href="#ks_scenefusion_client_unity_editor_sfui_default_scene_view_size" id="ks_scenefusion_client_unity_editor_sfui_default_scene_view_size"></a>

```csharp
public const float DEFAULT_SCENE_VIEW_SIZE = 1
```

#### Field Value

float

### OnFollowUserCamera <a href="#ks_scenefusion_client_unity_editor_sfui_onfollowusercamera" id="ks_scenefusion_client_unity_editor_sfui_onfollowusercamera"></a>

```csharp
public sfUI.Delegates.FollowCallback OnFollowUserCamera
```

#### Field Value

[sfUI](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfui.md).[Delegates](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfui/ks.scenefusion.client.unity.editor.sfui.delegates.md).[FollowCallback](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfui/ks.scenefusion.client.unity.editor.sfui.delegates/ks.scenefusion.client.unity.editor.sfui.delegates.followcallback.md)

### OnGotoUserCamera <a href="#ks_scenefusion_client_unity_editor_sfui_ongotousercamera" id="ks_scenefusion_client_unity_editor_sfui_ongotousercamera"></a>

```csharp
public sfUI.Delegates.GoToCallback OnGotoUserCamera
```

#### Field Value

[sfUI](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfui.md).[Delegates](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfui/ks.scenefusion.client.unity.editor.sfui.delegates.md).[GoToCallback](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfui/ks.scenefusion.client.unity.editor.sfui.delegates/ks.scenefusion.client.unity.editor.sfui.delegates.gotocallback.md)

### OnUnfollowUserCamera <a href="#ks_scenefusion_client_unity_editor_sfui_onunfollowusercamera" id="ks_scenefusion_client_unity_editor_sfui_onunfollowusercamera"></a>

```csharp
public sfUI.Delegates.UnfollowCallback OnUnfollowUserCamera
```

#### Field Value

[sfUI](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfui.md).[Delegates](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfui/ks.scenefusion.client.unity.editor.sfui.delegates.md).[UnfollowCallback](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfui/ks.scenefusion.client.unity.editor.sfui.delegates/ks.scenefusion.client.unity.editor.sfui.delegates.unfollowcallback.md)

### ViewportGetter <a href="#ks_scenefusion_client_unity_editor_sfui_viewportgetter" id="ks_scenefusion_client_unity_editor_sfui_viewportgetter"></a>

Delegate for getting the scene viewport rect.

```csharp
public sfUI.Delegates.ViewportGetter ViewportGetter
```

#### Field Value

[sfUI](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfui.md).[Delegates](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfui/ks.scenefusion.client.unity.editor.sfui.delegates.md).[ViewportGetter](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfui/ks.scenefusion.client.unity.editor.sfui.delegates/ks.scenefusion.client.unity.editor.sfui.delegates.viewportgetter.md)

## Methods

### FindWindow(string) <a href="#ks_scenefusion_client_unity_editor_sfui_findwindow_system_string" id="ks_scenefusion_client_unity_editor_sfui_findwindow_system_string"></a>

Finds a window of a type from the UnityEditor namespace if it is open. This can be used to get instances of internal Unity windows.

```csharp
public EditorWindow FindWindow(string className)
```

#### Parameters

`className` string

name of editor window class to find instance of.

#### Returns

EditorWindow

window, or null if the window wasn't found.

### FindWindows(string) <a href="#ks_scenefusion_client_unity_editor_sfui_findwindows_system_string" id="ks_scenefusion_client_unity_editor_sfui_findwindows_system_string"></a>

Finds all open windows of a type from the UnityEditor namespace. This can be used to get instances of internal Unity windows.

```csharp
public Object[] FindWindows(string className)
```

#### Parameters

`className` string

name of editor window class to find instances of.

#### Returns

Object\[]

windows of the given class name.

### FollowUserCamera(uint, bool) <a href="#ks_scenefusion_client_unity_editor_sfui_followusercamera_system_uint32_system_boolean" id="ks_scenefusion_client_unity_editor_sfui_followusercamera_system_uint32_system_boolean"></a>

Invoke a FollowUserCamera event

```csharp
public uint FollowUserCamera(uint userId, bool isFollowing)
```

#### Parameters

`userId` uint

`isFollowing` bool

#### Returns

uint

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

```csharp
public static sfUI Get()
```

#### Returns

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

singleton instance.

### GetInspectorLabelWidth(float) <a href="#ks_scenefusion_client_unity_editor_sfui_getinspectorlabelwidth_system_single" id="ks_scenefusion_client_unity_editor_sfui_getinspectorlabelwidth_system_single"></a>

Gets the width field labels would have in the inspector if it were the given width. The current view width is used if no width is provided. The width of field labels depends on the size of inspector window, but is always a fixed size in other windows. Set EditorGUIUtility.labelWidth to the returned value to make the label width scale with the window width like it does in the inpsector.

```csharp
public float GetInspectorLabelWidth(float width = 0)
```

#### Parameters

`width` float

width of window. If zero or less, the current view width is used.

#### Returns

float

### GetViewport(SceneView) <a href="#ks_scenefusion_client_unity_editor_sfui_getviewport_unityeditor_sceneview" id="ks_scenefusion_client_unity_editor_sfui_getviewport_unityeditor_sceneview"></a>

Gets the viewport rect by calling the ViewportGetter delegate.

```csharp
public Rect GetViewport(SceneView sceneView)
```

#### Parameters

`sceneView` SceneView

sceneView to get viewport from.

#### Returns

Rect

viewport, or (0, 0, 0, 0) if the ViewportGetter delegate is null.

### GotoUserCamera(uint) <a href="#ks_scenefusion_client_unity_editor_sfui_gotousercamera_system_uint32" id="ks_scenefusion_client_unity_editor_sfui_gotousercamera_system_uint32"></a>

Invoke a OnGotoUserCamera event

```csharp
public void GotoUserCamera(uint userId)
```

#### Parameters

`userId` uint

### MarkIconWindowsStale(Object) <a href="#ks_scenefusion_client_unity_editor_sfui_markiconwindowsstale_unityengine_object" id="ks_scenefusion_client_unity_editor_sfui_markiconwindowsstale_unityengine_object"></a>

Redraws the window(s) showing the uobject's icons on the next update. For game objects and components it's the hierarchy window, and for assets it's the project browser. For prefabs it is both.

```csharp
public void MarkIconWindowsStale(Object uobject)
```

#### Parameters

`uobject` Object

### MarkInspectorStale(Object, bool) <a href="#ks_scenefusion_client_unity_editor_sfui_markinspectorstale_unityengine_object_system_boolean" id="ks_scenefusion_client_unity_editor_sfui_markinspectorstale_unityengine_object_system_boolean"></a>

Redraws the inspector on the next update if the given object is selected.

```csharp
public void MarkInspectorStale(Object uobj, bool rebuildInspectors = false)
```

#### Parameters

`uobj` Object

if this is selected, will redraw the inspector.

`rebuildInspectors` bool

if true, rebuilds inspectors, which is slower but necessary for it to display properly if components were added or deleted.

### MarkProjectBrowserStale() <a href="#ks_scenefusion_client_unity_editor_sfui_markprojectbrowserstale" id="ks_scenefusion_client_unity_editor_sfui_markprojectbrowserstale"></a>

Redraws the project browser on the next update.

```csharp
public void MarkProjectBrowserStale()
```

### MarkSceneViewStale() <a href="#ks_scenefusion_client_unity_editor_sfui_marksceneviewstale" id="ks_scenefusion_client_unity_editor_sfui_marksceneviewstale"></a>

Redraws the scene view on the next update.

```csharp
public void MarkSceneViewStale()
```

### UnfollowUserCamera() <a href="#ks_scenefusion_client_unity_editor_sfui_unfollowusercamera" id="ks_scenefusion_client_unity_editor_sfui_unfollowusercamera"></a>

Invoke a UnfollowUserCamera event

```csharp
public void UnfollowUserCamera()
```
