IReleaseReceiver
You can implement a method to be called when the graph is released.
Please note that for Logic Graphs, this is called when the graph object is destroyed, regardless of the playback status of the graph.
Please note that for Function Graphs, this is called every time playback ends, even if you run the same function graph repeatedly on the same node.
How to write a script
- Implement
LogicToolkit.IReleaseReceiver
in types that inherit from various NodeComponent. - Implement
public void OnRelease()
.
Code example
|
|
In this example, we instantiate the prefab once at runtime and destroy the instantiated object on release.