ProtoFlux:Is Disposed: Difference between revisions

From Resonite Wiki
Created a page for the Is Disposed node.
 
Whoops, needs it's own example file.
 
Line 37: Line 37:
With this setup, and when the target slot is destroyed (and there is no longer any references to it), the '''DynamicReferenceVariable''' component will still have it stored on its field, showing the old ID along with it. This in turn makes the '''IsDisposed''' set to <code>true</code>.
With this setup, and when the target slot is destroyed (and there is no longer any references to it), the '''DynamicReferenceVariable''' component will still have it stored on its field, showing the old ID along with it. This in turn makes the '''IsDisposed''' set to <code>true</code>.


<gallery widths=480px heights=480px>File:IsRemoved Node Example 01.png|IsRemoved Node Example 01</gallery>
<gallery widths=480px heights=480px>File:IsDisposed Node Example 01.png|IsDisposed Node Example 01</gallery>


[[Category:ProtoFlux:References:Elements]]
[[Category:ProtoFlux:References:Elements]]

Latest revision as of 04:40, 23 May 2024

Is Disposed
Element
*
Elements

The Is Disposed node takes in a worker world element and returns if that element was disposed from the world. Destruction of the slot prevents the result from changing, as by the time the slot is gone, it is too late. There is however a method to check if something did get disposed, see the examples below.

Inputs

Element (Worker)

The worker world element in question.

Outputs

* (bool)

Returns if this element was disposed in this world.

Examples

There is a certain setup required to detect when a slot gets disposed, here is what you need and why:

With this setup, and when the target slot is destroyed (and there is no longer any references to it), the DynamicReferenceVariable component will still have it stored on its field, showing the old ID along with it. This in turn makes the IsDisposed set to true.