EvaluateComponent
EvaluateComponent can be written in a C# script.
How to create
- Click the “+” button in the Project window.
- Select Logic Toolkit > Scripts > Evaluate 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.EvaluateComponent
. - Apply
System.SerializableAttribute
to the type. - Implement
protected override bool OnEvaluate()
and write the processing at runtime.
Code example
|
|
In this example, when executed, it will check whether the space key
has been pressed and return the result.
A similar script can be created by selecting Input.GetKeyDown(KeyCode)
when generating the script.