ResultChangeDecorator
ResultChangeDecorator can be written in a C# script.
How to create
- 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.
How to write a script
- Create a class that inherits from
LogicToolkit.BehaviorTree.ResultChangeDecorator. - Apply
System.SerializableAttributeto 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.
Code example
|
|
This example returns the node results inverted.
In addition, a script called InvertResult is included in advance as a similar function.