ResultChangeDecorator
ResultChangeDecorator can be written in a C# script.
- Click the “+” button in the Project window.
- Select Logic Toolkit > Scripts > Decorator > Result Change Decorator C# Script from the menu.
- Enter the script name and confirm with Enter.
- Create a class that inherits from
LogicToolkit.BehaviorTree.ResultChangeDecorator
. - Apply
System.SerializableAttribute
to the type. - Implement
protected override bool OnResult(bool result)
and write the processing at runtime. protected override void OnActivated()
is called when activated.protected override void OnDeactivated()
is called when it becomes inactive.
|
|
This example returns the node results inverted.
In addition, a script called InvertResult is included in advance as a similar function.