LoopCheckDecorator
LoopCheckDecorator can be written in a C# script.
How to create
- Click the “+” button in the Project window.
- Select Logic Toolkit > Scripts > Decorator > Loop Check 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.LoopCheckDecorator
. - Apply
System.SerializableAttribute
to the type. - Implement
protected override bool OnNext()
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 repeats the node up to 10 times.
In addition, a script called LoopCount is included in advance as a similar function.