Search Results for

    Show / Hide Table of Contents

    Class MenuTree<T>

    A menu tree that is used by editor scripts to display nested menu options

    Inheritance
    object
    MenuTree<T>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: LobsterFramework
    Assembly: LobsterFramework.dll
    Syntax
    public class MenuTree<T>
    Type Parameters
    Name Description
    T

    The type of the items to be stored in the menu tree

    Constructors

    | Improve this Doc View Source

    MenuTree(string)

    Declaration
    public MenuTree(string name)
    Parameters
    Type Name Description
    string name

    Fields

    | Improve this Doc View Source

    menuName

    Name of this node

    Declaration
    public string menuName
    Field Value
    Type Description
    string
    | Improve this Doc View Source

    options

    Declaration
    public List<T> options
    Field Value
    Type Description
    List<T>
    | Improve this Doc View Source

    parentMenu

    Declaration
    public MenuTree<T> parentMenu
    Field Value
    Type Description
    MenuTree<T>
    | Improve this Doc View Source

    path

    Path to this node

    Declaration
    public string path
    Field Value
    Type Description
    string
    | Improve this Doc View Source

    subMenus

    Declaration
    public Dictionary<string, MenuTree<T>> subMenus
    Field Value
    Type Description
    Dictionary<string, MenuTree<T>>

    Methods

    | Improve this Doc View Source

    AddChild(MenuTree<T>)

    Add a child node to the tree. Circular reference is not allowed. Attempting to add ancestor nodes or nodes that already has a parent will have no effect.

    Declaration
    public void AddChild(MenuTree<T> child)
    Parameters
    Type Name Description
    MenuTree<T> child

    The child to be added

    | Improve this Doc View Source

    AddItem(MenuTree<T>, string, T)

    Add the item to the menu tree

    Declaration
    public static MenuTree<T> AddItem(MenuTree<T> root, string itemPath, T item)
    Parameters
    Type Name Description
    MenuTree<T> root

    The root of the menu tree

    string itemPath

    The location of this item in the tree

    T item

    The item to be added

    Returns
    Type Description
    MenuTree<T>

    The menu tree that directly holds the item

    | Improve this Doc View Source

    IsAncestor(MenuTree<T>)

    Check if the given tree is an ancestor of this menu tree.

    Declaration
    public bool IsAncestor(MenuTree<T> tree)
    Parameters
    Type Name Description
    MenuTree<T> tree

    The tree to be examined

    Returns
    Type Description
    bool

    true if the tree is an ancestor, otherwise false

    • Improve this Doc
    • View Source
    In This Article
    Back to top LobsterFramework documentation