TaskComponent
TaskComponent can be written in a C# script.
How to create
- Click the “+” button in the Project window.
- Select Logic Toolkit > Scripts > Task 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.TaskComponent
. - Apply
System.SerializableAttribute
to the type. protected override void OnActivated()
is called when activated.protected override void OnDeactivated()
is called when it becomes inactive.- Implement
protected override TaskStatus OnExecute()
and describe the processing at runtime.
Code example
|
|
This example returns success and exits after 1 second of execution.
In addition, a script called Wait For Seconds is included in advance as a similar function.