Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/customer/www/qualgame.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340
Decorator Node | BtEngineSDK

Decorator Node

DecoratorNode
Hierarchy:
Namespace BehaviorTreeEngine
Parent class TreeNonRootNode
Description:
Decorator Node is used to modify its child task in some way. The DecoratorNode class is a MonoBehaviorNodeBase and performs the corresponding responses of a Decorator Node instance from the behavior tree engine on the Unity engine side. The DecoratorNode class inherits some virtual functions of OnExecute, OnReport, OnConstruct, OnDestruct, OnReset, OnPause and OnStop for a derived class, i.e., NewDecoratorNode, to override.
Inherited 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.
Inherited Functions:
Init Initialize the properties of this mono behavior node.
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 was reported a node status of Executing from the OnExecute operation that had returned a node status of Failure.
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.
OnPause A node operation that is invoked when pausing the tree.
OnStop A node operation that is invoked when stopping the tree.
Deprecated Functions:
OnExecute, OnReport, OnNotify, OnTest, OnStep.
DecoratorNode.nodeType
Signature:
MonoBehaviorNodeType DecoratorNode.nodeType
Description:
The node type of this mono behavior node, which is always MonoBehaviorNodeType.Decorator.
DecoratorNode.OnExecute
Signature:
Tuple<bool, NodeStatus> DecoratorNode.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 Executing to itself by invoking its OnReport operation with a node status of Executing. 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.
DecoratorNode.OnReport
Signature:
NodeStatus DecoratorNode.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 was reported a node status of Executing from the OnExecute operation that had 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 the OnExecute operation. Override this method in a derived class of DecoratorNode.
Parameters:
Status The result node status that was reported from its child node (Success or Failure), or from its OnExecute operation (Executing).
Return Value:
A node status to indicate the next branch of execution flow for the Decorator Node.
DecoratorNode.OnConstruct
Signature:
void DecoratorNode.OnConstruct()
Description:
A node operation that is invoked when loading the tree. Override this method in a derived class of DecoratorNode.
DecoratorNode.OnDestruct 
Signature:
void DecoratorNode.OnDestruct()
Description:
A node operation that is invoked when destroying the tree. Override this method in a derived class of DecoratorNode.
DecoratorNode.OnReset
Signature:
void DecoratorNode.OnReset()
Description:
A node operation that is invoked when resetting the tree. Override this method in a derived class of DecoratorNode.
DecoratorNode.OnPause
Signature:
void DecoratorNode.OnPause()
Description:
A node operation that is invoked when pausing the tree. Override this method in a derived class of DecoratorNode.
DecoratorNode.OnStop
Signature:
void DecoratorNode.OnStop()
Description:
A node operation that is invoked when stopping the tree. Override this method in a derived class of DecoratorNode.