# GetOrCreateHandlerState<T>(HierarchyNodeType)

> Gets the state a node type handler keeps for this view model, creating it when there is none.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Hierarchy](/engine/6000.7/script-reference/unity/hierarchy.md)
* **Assembly:** UnityEngine.HierarchyCoreModule

```csharp
public T GetOrCreateHandlerState<T>(HierarchyNodeType nodeType) where T : class, IHierarchyNodeTypeHandlerViewModelState, new()
```

### Parameters

**** (\[HierarchyNodeType]\(/engine/6000.7/script-reference/unity/hierarchy/hierarchynodetype)): The node type of the handler owning the state.

### Returns

| Type | Description |
| ---- | ----------- |
| T    | The state.  |
