ServiceComponent
ServiceComponent can be written in a C# script.
How to create
- Click the “+” button in the Project window.
- Select Logic Toolkit > Scripts > Service Component 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.ServiceComponent. - Apply
System.SerializableAttributeto the type. protected override void OnActivated()is called when activated.protected override void OnDeactivated()is called when it becomes inactive.- Implement
LogicToolkit.IUpdateReceiveras necessary, and perform update processing for each frame withvoid OnUpdate().
Code example
|
|
In this example, using this script on a State or BehaviorTreeNode will stop the game's time progression while the node is active.