TheAutopilot (talk | contribs) No edit summary |
TheAutopilot (talk | contribs) No edit summary |
||
Line 17: | Line 17: | ||
== Behavior == | == Behavior == | ||
The component behaves similar to a [[Component:ValueCopy|ValueCopy]] with the list entry indicated by <code>Index</code> as its <code>Source</code>. | |||
Changes to <code>Index</code> or the list entries will affect <code>Target</code> whenever the drive is evaluated. | |||
On the other hand the <code>Source</code> of this component updates instantly. | |||
== Examples == | == Examples == | ||
[[File:ValueMultiplexer_ProtoFlux_1.png|thumb|center|500px|Array-like access from within ProtoFlux. Note the setting of <code>AllowWriteBack</code> and that you can only access a single value at a time!]] | |||
[[File:ValueMultiplexer_ProtoFlux_Wrapping_Index.png|thumb|center|500px|A demonstration of what happens when <code>Index</code> is outside the usual range. (wraps around)]] | |||
== See Also == | == See Also == |
Revision as of 16:33, 10 July 2024
Component image
This article or section is a Stub. You can help the Resonite Wiki by expanding it.
ValueMultiplexers allow to curate a list of values and drive a target with one of them.
They implement IValue which means that a reference to them can be used to create a Source node representing the currently indexed value. This enables using them like arrays when combined with a Source
of the Index
field.
Usage
Name | Type | Description |
---|---|---|
persistent
|
Bool | Determines whether or not this item will be saved to the server. |
UpdateOrder
|
Int | Controls the order in which this component is updated. |
Enabled
|
Bool | Controls whether or not this component is enabled. |
Target
|
field drive of T | A field which is driven with the currently selected |
Index
|
Int | 0-based index that determines which value of Values has been selected; values outside the range [0;length-1] are wrapped around internally.
|
Values
|
direct SyncFieldList`1<T> | A list of values which can also individually be driven or written to |
AllowWriteBack
|
Bool | Setting this to true redirects writes to Target or to a Source representing the selected value to the currently indexed list entry.
|
Behavior
The component behaves similar to a ValueCopy with the list entry indicated by Index
as its Source
.
Changes to Index
or the list entries will affect Target
whenever the drive is evaluated.
On the other hand the Source
of this component updates instantly.