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

# Class sfPrefabStageMap

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

Maintains a dictionary mapping prefab stage objects to prefab objects. The prefab stage is where you edit a prefab when you open a prefab. The objects in the prefab stage are not the real prefab; they are copies of the prefab objects which we call stage objects. Unity does not provide a mapping between stage objects and prefab objects so we build one ourselves with this class. Only one prefab stage can be active at a time, so we never need to map multiple prefab stages at the same time.

```csharp
public class sfPrefabStageMap
```

#### Inheritance

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

## Methods

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

```csharp
public static sfPrefabStageMap Get()
```

#### Returns

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

Singleton instance

### GetPrefabObject\<T>(T) <a href="#ks_scenefusion_client_unity_editor_sfprefabstagemap_getprefabobject__1___0" id="ks_scenefusion_client_unity_editor_sfprefabstagemap_getprefabobject__1___0"></a>

Gets the prefab object for a stage object.

```csharp
public T GetPrefabObject<T>(T stageObject) where T : Object
```

#### Parameters

`stageObject` T

Stage object to get prefab object for.

#### Returns

T

The prefab object for the stage object, or null if none was found.

#### Type Parameters

`T`

Type of object

### GetPrefabObject\<T>(ulong) <a href="#ks_scenefusion_client_unity_editor_sfprefabstagemap_getprefabobject__1_system_uint64" id="ks_scenefusion_client_unity_editor_sfprefabstagemap_getprefabobject__1_system_uint64"></a>

Gets the prefab object for a stage object.

```csharp
public T GetPrefabObject<T>(ulong uobjectId) where T : Object
```

#### Parameters

`uobjectId` ulong

Id of stage object to get prefab object for.

#### Returns

T

The prefab object for the stage object, or null if none was found.

#### Type Parameters

`T`

### Rebuild() <a href="#ks_scenefusion_client_unity_editor_sfprefabstagemap_rebuild" id="ks_scenefusion_client_unity_editor_sfprefabstagemap_rebuild"></a>

Rebuilds the map if a prefab stage is open.

```csharp
public void Rebuild()
```

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

Registers event listeners to build/clear the map when a prefab stage is opened/closed. If a prefab stage is already open, prompts the user to save unsaved changes before building the map.

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

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

Removes event listeners and clears the map.

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