-
-
Notifications
You must be signed in to change notification settings - Fork 0
Custom Node
Sam Orme edited this page Sep 24, 2022
·
1 revision
A node executes a piece of logic and returns a NodeResult of Running, Failure or Success. Nodes are the base class of all Composites and Decorators.
Noes have 3 main methods: OnStart()
, Update()
and OnEnd()
;
OnStart()
is called if it is the first time the node has executed. Use this to set up the fields of your node.
Update()
is called every time the node is executed and returns a NodeResult. This is where your main logic will be housed.
OnEnd()
is called when the Update method returns anything other than NodeResult.Running or if the node is aborted.
All nodes support aborting. Calling the Abort()
method on a node will reset various properties and call the OnEnd()
method for the node and all it's children.