Search Results for

    Show / Hide Table of Contents

    Class BehaviorTree

    Behavior tree is an execution tree, requires that the Root Node be set, derived from UnityEngine.ScriptableObject

    Inheritance
    System.Object
    BehaviorTree
    Namespace: GraphViewBehaviorTree
    Assembly: cs.temp.dll.dll
    Syntax
    [Serializable]
    public class BehaviorTree : ScriptableObject

    Fields

    rootNode

    Declaration
    public Node rootNode
    Field Value
    Type Description
    Node

    The Node to start the Behavior tree.

    treeState

    Declaration
    public Node.State treeState
    Field Value
    Type Description
    Node.State

    The State the tree is in.

    Methods

    AddChild(Node, Node)

    Add a child node to the parent.

    Declaration
    public void AddChild(Node parent, Node child)
    Parameters
    Type Name Description
    Node parent

    The parent Node.

    Node child

    The Node to add to the parent.

    Clone()

    Clone the Tree.

    Declaration
    public BehaviorTree Clone()
    Returns
    Type Description
    BehaviorTree

    A Clone of the tree

    CreateNode(Type)

    Create a new Node and add it to the nodes.

    Declaration
    public Node CreateNode(Type type)
    Parameters
    Type Name Description
    System.Type type

    The Type of Node to create.

    Returns
    Type Description
    Node

    DeleteNode(Node)

    Delete a Node from the tree.

    Declaration
    public void DeleteNode(Node node)
    Parameters
    Type Name Description
    Node node

    The Node to Delete.

    GetChildren(Node)

    Get a list of children from the parent.

    Declaration
    public List<Node> GetChildren(Node parent)
    Parameters
    Type Name Description
    Node parent

    The node to get the children from

    Returns
    Type Description
    List<Node>

    A list of children Nodes that the parent contains.

    GetNodes()

    Declaration
    public List<Node> GetNodes()
    Returns
    Type Description
    List<Node>

    Get all of the Nodes in the Tree.

    RemoveChild(Node, Node)

    Remove a node from the parent.

    Declaration
    public void RemoveChild(Node parent, Node child)
    Parameters
    Type Name Description
    Node parent

    The parent Node.

    Node child

    The Node to remove from the parent.

    Traverse(Node, Action<Node>)

    Traverse the node and run the Action.

    Declaration
    public void Traverse(Node node, Action<Node> visitor)
    Parameters
    Type Name Description
    Node node
    System.Action<Node> visitor

    Update()

    Update the Tree by updating the root node.

    Declaration
    public Node.State Update()
    Returns
    Type Description
    Node.State

    The state of the tree.

    In This Article
    Back to top Generated by DocFX