MonoBehaviorNodeBase | |
Hierarchy: | |
Namespace | BehaviorTreeEngine |
Parent class | UnityEngine.MonoBehavior |
Description: | |
Mono Behavior Node Base represents an abstract parent node of Forest Node, Tree Root Node and Tree Non Root Node. The MonoBehaviorNodeBase class is a UnityEngine.MonoBehavior and defines some common properties of its child nodes. The MonoBehaviorNodeBase class defines some virtual functions of OnExecute, OnReport, OnNotify, OnTest, OnStep, OnPause, OnStop, OnConstruct, OnDestruct and OnReset for a derived class of ForestNode, TreeRootNode, DecoratorNode, ConditionNode or ActionNode to override. | |
Variables: | |
nodeType | The node type of this mono behavior node. |
forestIndex | The forest index of this mono behavior node. |
treeIndex | The tree index of this mono behavior node. |
nodeIndex | The node index of this mono behavior node. |
forestName | The forest name of this mono behavior node. |
treeName | The tree name of this mono behavior node. |
nodeName | The node name of this mono behavior node. |
Functions: | |
Init | Initialize the properties of this mono behavior node. |
OnExecute | A node operation that is invoked when executing the tree. |
OnReport | A node operation that is invoked when the tree completes an execution traversal with a result status, i.e., when the Tree Root Node was reported a node status of Success or Failure from its child node. |
OnNotify | A node operation that is invoked when the tree execution traversal was suspended due to re-execution request or interruption, i.e., when the Tree Root Node was notified executing by a Decorator Node or a Condition Node whose OnExecute or OnTest operation returned a node status of Executing, or was notified interrupt by an interrupted node when pausing, stopping, resetting or destroying an executing tree. |
OnPause | A node operation that is invoked when pausing the tree. |
OnStop | A node operation that is invoked when stopping the tree. |
OnExecute | A node operation that is invoked when executing the Decorator Node, or when the OnReport operation returned a node status of Executing. |
OnReport | A node operation that is invoked when the Decorator Node was reported a node status of Success or Failure from its child node, or when the OnExecute operation returned a node status of Failure. |
OnTest | A node operation that is invoked when executing the Condition Node. |
OnStep | A node operation that is invoked when executing the Action Node. |
OnConstruct | A node operation that is invoked when loading the tree. |
OnDestruct | A node operation that is invoked when destroying the tree. |
OnReset | A node operation that is invoked when resetting the tree. |
MonoBehaviorNodeBase.nodeType | |
Signature: | |
MonoBehaviorNodeType MonoBehaviorNodeBase.nodeType | |
Description: | |
The node type of this mono behavior node, which is always MonoBehaviorNodeType.Base. | |
MonoBehaviorNodeBase.forestIndex | |
Signature: | |
uint MonoBehaviorNodeBase.forestIndex | |
Description: | |
The forest index of this mono behavior node. | |
MonoBehaviorNodeBase.treeIndex | |
Signature: | |
uint MonoBehaviorNodeBase.treeIndex | |
Description: | |
The tree index of this mono behavior node. | |
MonoBehaviorNodeBase.nodeIndex | |
Signature: | |
uint MonoBehaviorNodeBase.nodeIndex | |
Description: | |
The node index of this mono behavior node. | |
MonoBehaviorNodeBase.forestName | |
Signature: | |
string MonoBehaviorNodeBase.forestName | |
Description: | |
The forest name of this mono behavior node. | |
MonoBehaviorNodeBase.treeName | |
Signature: | |
string MonoBehaviorNodeBase.treeName | |
Description: | |
The tree name of this mono behavior node. | |
MonoBehaviorNodeBase.nodeName | |
Signature: | |
uint MonoBehaviorNodeBase.nodeName | |
Description: | |
The node name of this mono behavior node. | |
MonoBehaviorNodeBase.Init | |
Signature: | |
void MonoBehaviorNodeBase.Init(uint ForestIndex, uint TreeIndex, uint NodeIndex, string ForestName, string TreeName, string NodeName) void MonoBehaviorNodeBase.Init(uint ForestIndex, uint TreeIndex, uint NodeIndex, string TreeName, string NodeName) void MonoBehaviorNodeBase.Init(uint ForestIndex, uint TreeIndex, uint NodeIndex, string NodeName) |
|
Description: | |
Initializes the properties of this mono behavior node. | |
Parameters: | |
ForestIndex | The forest index of this mono behavior node. |
TreeIndex | The tree index of this mono behavior node. |
NodeIndex | The node index of this mono behavior node. |
ForestName | The forest name of this mono behavior node. |
TreeName | The tree name of this mono behavior node. |
NodeName | The node name of this mono behavior node. |
MonoBehaviorNodeBase.OnExecute | |
Signature: | |
void MonoBehaviorNodeBase.OnExecute(uint AccuLoopCount) | |
Description: | |
A node operation that is invoked when executing the tree. Override this method in a derived class of TreeRootNode. | |
Parameters: | |
AccuLoopCount | The accumulated loop count when invoking this operation as specified by the basic play mode. |
MonoBehaviorNodeBase.OnReport | |
Signature: | |
void MonoBehaviorNodeBase.OnReport(NodeStatus Status) | |
Description: | |
A node operation that is invoked when the tree completes an execution traversal with a result status, e.g., when the Tree Root Node was reported a node status of Success or Failure from its child node. Override this method in a derived class of TreeRootNode. | |
Parameters: | |
Status | The result node status (can be either a Success or a Failure) that was reported from its child node. |
MonoBehaviorNodeBase.OnNotify | |
Signature: | |
void MonoBehaviorNodeBase.OnNotify(NotifyStatus Status, uint NodeIndex, uint AccuLoopCount) | |
Description: | |
A node operation that is invoked when the tree execution traversal was suspended due to re-execution request or interruption, i.e., when the Tree Root Node was notified executing by a Decorator Node or a Condition Node whose OnExecute or OnTest operation returned a node status of Executing, or was notified interrupt by an interrupted node when pausing, stopping, resetting or destroying an executing tree. Override this method in a derived class of TreeRootNode. | |
Parameters: | |
Status | A status of notification that indicates the tree execution traversal was suspended due to re-execution request from an arbitrary executing node (NotifyStatus.Executing) or interruption when pausing, stopping, resetting or destroying the tree from an arbitrary interrupted node (NotifyStatus.Interrupt). |
NodeIndex | The node index of an arbitrary executing node or interrupted node that notified executing or interrupt. |
AccuLoopCount | The accumulated loop count when invoking this operation as specified by the basic play mode. |
MonoBehaviorNodeBase.OnPause | |
Signature: | |
void MonoBehaviorNodeBase.OnPause() | |
Description: | |
A node operation that is invoked when pausing the tree. Override this method in a derived class of TreeRootNode. | |
MonoBehaviorNodeBase.OnStop | |
Signature: | |
void MonoBehaviorNodeBase.OnStop() | |
Description: | |
A node operation that is invoked when stopping the tree. Override this method in a derived class of TreeRootNode. | |
MonoBehaviorNodeBase.OnExecute | |
Signature: | |
Tuple<bool, NodeStatus> MonoBehaviorNodeBase.OnExecute() | |
Description: | |
A node operation that is invoked when executing the Decorator Node, or when the OnReport operation returned a node status of Executing. This operation is getting invoked every frame repeatedly until returning a true as Item1. When this operation had done repeat, i.e., Item1 was true, if a node status of Success was returned as Item2, the Decorator Node continues to execute its child node. If a node status of Failure was returned, the Decorator Node reports a node status of Failure to itself by invoking its OnReport operation with a node status of Failure. If a node status of Executing was returned, the Decorator Node notifies executing to the lowest parent Parallel Node if it is in a Parallel Node child sub-tree and all the way up to the Tree Root Node, otherwise, to the Tree Root Node directly, to request one more execution and get invoked again. Override this method in a derived class of DecoratorNode. | |
Return Value: | |
A tuple. Item1: true when this operation has done repeat; false otherwise. Item2: A node status to determine the next branch of execution flow for the Decorator Node. Null: continues the repeat. | |
MonoBehaviorNodeBase.OnReport | |
Signature: | |
NodeStatus MonoBehaviorNodeBase.OnReport(NodeStatus Status) | |
Description: | |
A node operation that is invoked when the Decorator Node was reported a node status of Success or Failure from its child node, or when the OnExecute operation returned a node status of Failure. If a node status of Success or Failure was returned, the Decorator Node reports the result node status to its parent node. If a node status of Executing was returned, the Decorator Node continues to execute itself by invoking its OnExecute operation. Override this method in a derived class of DecoratorNode. | |
Parameters: | |
Status | The result node status (can be either a Success or a Failure) that was reported from its child node. |
Return Value: | |
A node status to determine the next branch of execution flow for the Decorator Node. | |
MonoBehaviorNodeBase.OnTest | |
Signature: | |
Tuple<bool, NodeStatus> MonoBehaviorNodeBase.OnTest() | |
Description: | |
A node operation that is invoked when executing the Condition Node. This operation is getting invoked every frame repeatedly until returning a true as Item1. When this operation had done repeat, i.e., Item1 was true, if a node status of Success or Failure was returned as Item2, the Condition Node reports the result node status to its parent node. If a node status of Executing was returned, the Condition Node notifies executing to the lowest parent Parallel Node if it is in a Parallel Node child sub-tree and all the way up to the Tree Root Node, otherwise, to the Tree Root Node directly, to request one more execution and get invoked again. Override this method in a derived class of ConditionNode. | |
Return Value: | |
A tuple. Item1: true when this operation has done repeat; false otherwise. Item2: a node status to indicate the test result of the Condition Node. Null: continues the repeat. | |
MonoBehaviorNodeBase.OnStep | |
Signature: | |
bool MonoBehaviorNodeBase.OnStep() | |
Description: | |
A node operation that is invoked when executing the Action Node. This operation is getting invoked every frame repeatedly until returning a true. Based on the Action Node Policy, the OnStep operation of the Action Node always reports a fixed node status of either Success or Failure after performing the node task to its parent node. Override this method in a derived class of ActionNode. | |
Return Value: | |
True when this operation has done repeat; false otherwise. | |
MonoBehaviorNodeBase.OnConstruct | |
Signature: | |
void MonoBehaviorNodeBase.OnConstruct() | |
Description: | |
A node operation that is invoked when loading the tree. Override this method in a derived class of ForestNode, TreeRootNode, DecoratorNode, ConditionNode or ActionNode. | |
MonoBehaviorNodeBase.OnDestruct | |
Signature: | |
void MonoBehaviorNodeBase.OnDestruct() | |
Description: | |
A node operation that is invoked when destroying the tree. Override this method in a derived class of ForestNode, TreeRootNode, DecoratorNode, ConditionNode or ActionNode. | |
MonoBehaviorNodeBase.OnReset | |
Signature: | |
void MonoBehaviorNodeBase.OnReset() | |
Description: | |
A node operation that is invoked when resetting the tree. Override this method in a derived class of TreeRootNode, DecoratorNode, ConditionNode or ActionNode. |
Copyright © 2016-2020 Qualgame, LLC