HierarchyWindow
Represents the Hierarchy Window in the Unity Editor. Use this class to customize the Hierarchy window, register node type handlers, and handle view events.
Read time 8 minutesLast updated 12 days ago
Definition
- Type: Class
- Namespace: Unity.Hierarchy.Editor
- Assembly: UnityEditor
- Inherits from: EditorWindow
- Implements: IHasCustomMenu, ISerializationCallbackReceiver
[EditorWindowTitle(title = "Hierarchy")]public sealed class HierarchyWindow : EditorWindow, IHasCustomMenu, ISerializationCallbackReceiver
Constructors
Constructor | Description |
|---|---|
| HierarchyWindow() | Creates a new HierarchyWindow. |
Properties
Property | Description |
|---|---|
| View | Gets the HierarchyView currently being displayed in this HierarchyWindow. |
Methods
Method | Description |
|---|---|
| SetSearchText | Sets the search filter text in the HierarchyWindow. |
| UpdateEditorSelection | Updates the Editor Selection to match the EntityId of the nodes that are flagged as selected in the Hierarchy. |
Static Events
Member | Description |
|---|---|
| BindView | Raised when a HierarchyView is bound to the Hierarchy window. Typically used to load additional stylesheets and add styles to HierarchyView.StyleContainer. |
| BindViewItem | Raised when a HierarchyViewItem is bound to a HierarchyView. Use this event to customize the view item. |
| GetTooltip | Customize the tooltip that displays when the mouse hovers the node name label. |
| PopulateContextMenu | Raised when a right click is handled on a node or on the background of the HierarchyView. |
| UnbindView | Raised when a HierarchyView is about to be unbound from the HierarchyWindow. Typically used to cleanup resources associated with the view. |
| UnbindViewItem | Raised when a HierarchyViewItem is unbound from a HierarchyView. Use this event to cleanup the view item. Note that hierarchy view item are recycled by handler, so unbinding doesn't mean destruction. For performance reasons, the recommended best practice is to not undo styles or modifications done during binding in this unbind event. |
Delegates
Delegate | Description |
|---|---|
| HierarchyWindow.BindViewEventHandler | Delegate type for the HierarchyWindow.BindView event. |
| HierarchyWindow.BindViewItemEventHandler | Delegate type for the HierarchyWindow.BindViewItem event. |
| HierarchyWindow.GetTooltipEventHandler | Delegate type for the HierarchyWindow.GetTooltip event. |
| HierarchyWindow.PopulateContextMenuEventHandler | Delegate type for the HierarchyWindow.PopulateContextMenu event. |
| HierarchyWindow.UnbindViewEventHandler | Delegate type for the HierarchyWindow.UnbindView event. |
| HierarchyWindow.UnbindViewItemEventHandler | Delegate type for the HierarchyWindow.UnbindViewItem event. |
Inheritance
Operators
Operator | Description |
|---|---|
| operator == | Compares two object references to see if they refer to the same object. |
| bool | Determines whether the object exists. |
| operator != | Compares if two objects refer to a different object. |