docs.unity3d.com
    Show / Hide Table of Contents

    Class HierarchyTreeView

    Tree view GUI for the MARS Simulation View hierarchy Hierarchy to tree view starting code brought from

    Inheritance
    Object
    TreeView
    HierarchyTreeView
    Inherited Members
    TreeView.Reload()
    TreeView.Repaint()
    TreeView.GetCellRectForTreeFoldouts(Rect)
    TreeView.GetRowRect(Int32)
    TreeView.GetRows()
    UnityEditor.IMGUI.Controls.TreeView.FindRows(System.Collections.Generic.IList<System.Int32>)
    TreeView.FindItem(Int32, TreeViewItem)
    UnityEditor.IMGUI.Controls.TreeView.GetFirstAndLastVisibleRows(System.Int32, System.Int32)
    TreeView.ExpandAll()
    TreeView.CollapseAll()
    TreeView.SetExpandedRecursive(Int32, Boolean)
    TreeView.SetExpanded(Int32, Boolean)
    UnityEditor.IMGUI.Controls.TreeView.SetExpanded(System.Collections.Generic.IList<System.Int32>)
    TreeView.GetExpanded()
    TreeView.IsExpanded(Int32)
    TreeView.GetSelection()
    UnityEditor.IMGUI.Controls.TreeView.SetSelection(System.Collections.Generic.IList<System.Int32>)
    UnityEditor.IMGUI.Controls.TreeView.SetSelection(System.Collections.Generic.IList<System.Int32>, UnityEditor.IMGUI.Controls.TreeViewSelectionOptions)
    TreeView.IsSelected(Int32)
    TreeView.HasSelection()
    TreeView.HasFocus()
    TreeView.SetFocus()
    TreeView.SetFocusAndEnsureSelectedItem()
    TreeView.SelectionClick(TreeViewItem, Boolean)
    TreeView.BeginRename(TreeViewItem)
    TreeView.BeginRename(TreeViewItem, Single)
    TreeView.EndRename()
    TreeView.FrameItem(Int32)
    TreeView.OnGUI(Rect)
    TreeView.SelectAllRows()
    TreeView.GetFoldoutIndent(TreeViewItem)
    TreeView.GetContentIndent(TreeViewItem)
    UnityEditor.IMGUI.Controls.TreeView.SortItemIDsInRowOrder(System.Collections.Generic.IList<System.Int32>)
    UnityEditor.IMGUI.Controls.TreeView.CenterRectUsingSingleLineHeight(UnityEngine.Rect)
    UnityEditor.IMGUI.Controls.TreeView.AddExpandedRows(UnityEditor.IMGUI.Controls.TreeViewItem, System.Collections.Generic.IList<UnityEditor.IMGUI.Controls.TreeViewItem>)
    TreeView.SingleClickedItem(Int32)
    TreeView.ContextClickedItem(Int32)
    TreeView.ContextClicked()
    TreeView.ExpandedStateChanged()
    TreeView.SearchChanged(String)
    TreeView.KeyEvent()
    TreeView.CanMultiSelect(TreeViewItem)
    TreeView.CanRename(TreeViewItem)
    UnityEditor.IMGUI.Controls.TreeView.RenameEnded(UnityEditor.IMGUI.Controls.TreeView.RenameEndedArgs)
    UnityEditor.IMGUI.Controls.TreeView.CanStartDrag(UnityEditor.IMGUI.Controls.TreeView.CanStartDragArgs)
    UnityEditor.IMGUI.Controls.TreeView.SetupDragAndDrop(UnityEditor.IMGUI.Controls.TreeView.SetupDragAndDropArgs)
    UnityEditor.IMGUI.Controls.TreeView.HandleDragAndDrop(UnityEditor.IMGUI.Controls.TreeView.DragAndDropArgs)
    TreeView.CanBeParent(TreeViewItem)
    TreeView.CanChangeExpandedState(TreeViewItem)
    TreeView.DoesItemMatchSearch(TreeViewItem, String)
    TreeView.BeforeRowsGUI()
    TreeView.AfterRowsGUI()
    TreeView.RefreshCustomRowHeights()
    TreeView.GetCustomRowHeight(Int32, TreeViewItem)
    TreeView.GetRenameRect(Rect, Int32, TreeViewItem)
    TreeView.CommandEventHandling()
    UnityEditor.IMGUI.Controls.TreeView.SetupParentsAndChildrenFromDepths(UnityEditor.IMGUI.Controls.TreeViewItem, System.Collections.Generic.IList<UnityEditor.IMGUI.Controls.TreeViewItem>)
    TreeView.SetupDepthsFromParentsAndChildren(TreeViewItem)
    TreeView.CreateChildListForCollapsedParent()
    UnityEditor.IMGUI.Controls.TreeView.IsChildListForACollapsedParent(System.Collections.Generic.IList<UnityEditor.IMGUI.Controls.TreeViewItem>)
    TreeView.getNewSelectionOverride
    TreeView.foldoutOverride
    TreeView.state
    TreeView.multiColumnHeader
    TreeView.rootItem
    TreeView.isInitialized
    TreeView.treeViewRect
    TreeView.baseIndent
    TreeView.foldoutWidth
    TreeView.extraSpaceBeforeIconAndLabel
    TreeView.customFoldoutYOffset
    TreeView.columnIndexForTreeFoldouts
    TreeView.useScrollView
    TreeView.depthIndentWidth
    TreeView.showAlternatingRowBackgrounds
    TreeView.showBorder
    TreeView.showingHorizontalScrollBar
    TreeView.showingVerticalScrollBar
    TreeView.cellMargin
    TreeView.totalHeight
    TreeView.rowHeight
    TreeView.treeViewControlID
    TreeView.isDragging
    TreeView.hasSearch
    TreeView.searchString
    Namespace: UnityEditor.MARS.Simulation
    Syntax
    [MovedFrom("Unity.MARS")]
    public class HierarchyTreeView : TreeView

    Constructors

    HierarchyTreeView(TreeViewState, HierarchyState, Boolean, Boolean)

    Creates the HierarchyTreeView for a simulation hierarchy

    Declaration
    public HierarchyTreeView(TreeViewState treeViewState, HierarchyState hierarchyState, bool isEnvironmentHierarchy, bool needsStateCached)
    Parameters
    Type Name Description
    TreeViewState treeViewState

    The serializable state of the tree view

    HierarchyState hierarchyState

    State of the tree view with extra data for the simulation

    Boolean isEnvironmentHierarchy

    Is the tree view for the simulated environment

    Boolean needsStateCached

    Is the cached state being cached or restored

    Properties

    horizontalOffset

    Offset for tree view GUI drawing, used for horizontal scrolling

    Declaration
    public float horizontalOffset { get; protected set; }
    Property Value
    Type Description
    Single

    MaxHeight

    The maximum height of the tree view's scroll area

    Declaration
    public float MaxHeight { get; set; }
    Property Value
    Type Description
    Single

    selectedRowY

    The height of the selected row

    Declaration
    public float selectedRowY { get; set; }
    Property Value
    Type Description
    Single

    StyleName

    Sets the GUIStyle name for the tree view's container

    Declaration
    public string StyleName { get; set; }
    Property Value
    Type Description
    String

    Methods

    BuildRoot()

    Creates the full tree of the TreeViewItems and returns the root

    Declaration
    protected override TreeViewItem BuildRoot()
    Returns
    Type Description
    TreeViewItem

    The root of the tree. This item can later be accessed by 'rootItem'.

    Overrides
    TreeView.BuildRoot()

    BuildRows(TreeViewItem)

    Generates the rows in the TreeView

    Declaration
    protected override IList<TreeViewItem> BuildRows(TreeViewItem treeRoot)
    Parameters
    Type Name Description
    TreeViewItem treeRoot

    Root item that was created in the BuildRoot method.

    Returns
    Type Description
    IList<TreeViewItem>

    The rows list shown in the TreeView. Can later be accessed using GetRows().

    Overrides
    TreeView.BuildRows(TreeViewItem)

    CacheState()

    Cache the state based on the transform so when they IDs change on re-simulation the state can be restored

    Declaration
    public void CacheState()

    DoubleClickedItem(Int32)

    Method to handle double click events on an item.

    Declaration
    protected override void DoubleClickedItem(int id)
    Parameters
    Type Name Description
    Int32 id

    ID of TreeViewItem that was double clicked.

    Overrides
    TreeView.DoubleClickedItem(Int32)

    DrawScrollingTreeView(Vector2, ref Boolean, Boolean)

    Draw the hierarchy tree view the horizontal and vertical scrolling

    Declaration
    public Vector2 DrawScrollingTreeView(Vector2 scrollPosition, ref bool scrollToSelected, bool enabled)
    Parameters
    Type Name Description
    Vector2 scrollPosition

    Scrolling position

    Boolean scrollToSelected

    Scroll to the selected item in the hierarchy

    Boolean enabled

    Is the simulation active to so the hierarchy can be displayed

    Returns
    Type Description
    Vector2

    Finalize()

    Declaration
    protected void Finalize()

    GetAncestors(Int32)

    This method is e.g. used for revealing items that are currently under a collapsed item.

    Declaration
    protected override IList<int> GetAncestors(int id)
    Parameters
    Type Name Description
    Int32 id

    TreeViewItem ID.

    Returns
    Type Description
    IList<Int32>

    List of all the ancestors of a given item with ID id.

    Overrides
    TreeView.GetAncestors(Int32)

    GetDescendantsThatHaveChildren(Int32)

    Returns all descendants for the item with ID id that have children.

    Declaration
    protected override IList<int> GetDescendantsThatHaveChildren(int id)
    Parameters
    Type Name Description
    Int32 id

    TreeViewItem ID.

    Returns
    Type Description
    IList<Int32>

    Descendants that have children.

    Overrides
    TreeView.GetDescendantsThatHaveChildren(Int32)

    PingObjects(Transform[])

    Ping the selected items in the hierarchy

    Declaration
    public static void PingObjects(Transform[] selection)
    Parameters
    Type Name Description
    Transform[] selection

    RestoreState()

    Restore the previously cached state

    Declaration
    public void RestoreState()

    RowGUI(TreeView.RowGUIArgs)

    Method to add GUI content for the rows in the TreeView.

    Declaration
    protected override void RowGUI(TreeView.RowGUIArgs args)
    Parameters
    Type Name Description
    TreeView.RowGUIArgs args

    Row data.

    Overrides
    UnityEditor.IMGUI.Controls.TreeView.RowGUI(UnityEditor.IMGUI.Controls.TreeView.RowGUIArgs)

    SelectionChanged(IList<Int32>)

    Method to get notified of selection changes.

    Declaration
    protected override void SelectionChanged(IList<int> selectedIds)
    Parameters
    Type Name Description
    IList<Int32> selectedIds

    TreeViewItem IDs.

    Overrides
    UnityEditor.IMGUI.Controls.TreeView.SelectionChanged(System.Collections.Generic.IList<System.Int32>)

    UnsetPing()

    Clear the pinged items

    Declaration
    public static void UnsetPing()
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023