Class Node
Base class for all nodes in the Behavior tree.
Namespace: GraphViewBehaviorTree.Nodes
Assembly: cs.temp.dll.dll
Syntax
[Serializable]
public abstract class Node : ScriptableObject
Fields
guid
Declaration
public string guid
Field Value
| Type | Description |
|---|---|
| System.String | The GUID of the Node View, used to get the Node View that this Node is associated with. |
hasMultipleParents
Declaration
public bool hasMultipleParents
Field Value
| Type | Description |
|---|---|
| System.Boolean | Does this node have more then one parent. |
nodeGraphPosition
Declaration
public Vector2 nodeGraphPosition
Field Value
| Type | Description |
|---|---|
| Vector2 | The Position in the Behavior Tree View that this Node is at. |
state
Declaration
public Node.State state
Field Value
| Type | Description |
|---|---|
| Node.State | The State the Node is in. |
Properties
IsStarted
Declaration
public bool IsStarted { get; protected set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Has the node started. |
Methods
AddChild(Node)
Add the child node to this node.
Declaration
public virtual void AddChild(Node childNode)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | childNode | The Node to add as a Child. |
Clone()
Clone the Node.
Declaration
public Node Clone()
Returns
| Type | Description |
|---|---|
| Node | A Clone of the Node. |
GetChildren()
Get a list of children the node contains.
Declaration
public virtual List<Node> GetChildren()
Returns
| Type | Description |
|---|---|
| List<Node> | A list of children Nodes. |
NodeReset()
Reset the Node. Calls all Nodes children to Reset. If the Node is Started calls OnStop() then sets started to false. Set the State to running.
Declaration
public virtual void NodeReset()
OnStart()
Runs when the Node first starts running. Initialize the Node.
Declaration
protected abstract void OnStart()
OnStop()
Runs when the Node Stops. Any Cleanup that the Node may need to do.
Declaration
protected abstract void OnStop()
OnUpdate()
Runs every Update of the Node.
Declaration
protected abstract Node.State OnUpdate()
Returns
| Type | Description |
|---|---|
| Node.State | The State the Node is in once it finishes Updating. |
RemoveChild(Node)
Remove a Child from the Node.
Declaration
public virtual void RemoveChild(Node childNode)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | childNode | The Child to remove. |
Update()
Update the Node.
Declaration
public Node.State Update()
Returns
| Type | Description |
|---|---|
| Node.State | The state that the Node is in. |