IInitializeReceiver
You can implement a method to be called when the graph is initialized.
Note that for function graphs, this will be called every time before playback starts, even if you run the same function graph repeatedly on the same node.
How to write a script
- Implement
LogicToolkit.IInitializeReceiver
in types that inherit from various NodeComponents. - Implement
public void OnInitialize()
.
Code example
|
|
In this example, the Rigidbody component added to the playback object of the graph is obtained in advance at initialization, and a force is applied to the obtained Rigidbody when executed.