lab  2016-03-28
lightweight ai behaviour trees framework for Unity 3D
lab.TreeNode Class Reference

Node that gives possibility to run other AiTree. More...

Inherits lab.ANode.

Public Member Functions

override bool Run (AiBlackboard parameters, IList< AiTree > trees, List< ATaskScript > tasks)
 Runs this node. More...
 
override bool DebugRun (AiBlackboard parameters, IList< AiTree > trees, int level, int nodeIndex)
 Runs debug this node. More...
 

Properties

int TreeIndex [get, set]
 Sets/Gets index of AiTree to run. More...
 

Detailed Description

Node that gives possibility to run other AiTree.

AiBehaviour is a container for many trees, it is possible to have multiple trees for one behaviour and run them in different circumstances. AiTree gives another oppotrunity, to make AiTree more readable by dividing them on smaller chunks and running by this node.

Member Function Documentation

override bool lab.TreeNode.DebugRun ( AiBlackboard  parameters,
IList< AiTree trees,
int  level,
int  nodeIndex 
)
virtual

Runs debug this node.

Parameters
parametersAiBlackboard with global parameters.
treesReadonly list with all ai trees.
levelLevel of how deep we are in this AiTree.
nodeIndexIndex of current node in parent's node. If this is root, nodeIndex is 0.
Returns
True if debug run succeed. Otherwise false.

Implements lab.ANode.

override bool lab.TreeNode.Run ( AiBlackboard  parameters,
IList< AiTree trees,
List< ATaskScript tasks 
)
virtual

Runs this node.

Parameters
parametersAiBlackboard with global parameters.
treesReadonly list with all ai trees.
tasksList of task scripts to bind with task nodes.
Returns
True if node succeed. Otherwise false.

Implements lab.ANode.

Property Documentation

int lab.TreeNode.TreeIndex
getset

Sets/Gets index of AiTree to run.


The documentation for this class was generated from the following file: