> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/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/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.kshierarchypreserver.md).

# Class ksHierarchyPreserver

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

Provides methods for storing and restoring the state of all hierarchy windows. The state consists of which scenes are loaded, which scenes/objects are expanded, and which objects are selected. Useful for preserving hierarchy state after loading different scenes during publishing.

```csharp
public class ksHierarchyPreserver
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) â† [ksHierarchyPreserver](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.kshierarchypreserver.md)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Methods

### RestoreHierarchy() <a href="#ks_reactor_client_unity_editor_kshierarchypreserver_restorehierarchy" id="ks_reactor_client_unity_editor_kshierarchypreserver_restorehierarchy"></a>

Restores the state of the hierarchy that was stored using [StoreHierarchy](#KS_Reactor_Client_Unity_Editor_ksHierarchyPreserver_StoreHierarchy). Does nothing if [StoreHierarchy](#KS_Reactor_Client_Unity_Editor_ksHierarchyPreserver_StoreHierarchy) was never called.

```csharp
public void RestoreHierarchy()
```

### StoreHierarchy() <a href="#ks_reactor_client_unity_editor_kshierarchypreserver_storehierarchy" id="ks_reactor_client_unity_editor_kshierarchypreserver_storehierarchy"></a>

Stores the state of the hierarchy which can be restored later using [RestoreHierarchy](#KS_Reactor_Client_Unity_Editor_ksHierarchyPreserver_RestoreHierarchy).

```csharp
public void StoreHierarchy()
```
