Component:ValueMultiplexer: Difference between revisions

From Resonite Wiki
Automated: create new component page
 
No edit summary
Line 4: Line 4:
}}
}}
{{stub}}
{{stub}}
ValueMultiplexers allow to curate a list of values and [[Drive|drive]] a target with one of them.
They implement [[Type:IValue`1|IValue]] which means that a reference to them can be used to create a [[ProtoFlux:Source|Source]] node representing the currently indexed value. This enables using them like arrays when combined with a <code>Source</code> of the <code>Index</code> field.


== Usage ==
== Usage ==
{{Table ComponentFields
{{Table ComponentFields
|Target|{{RootFieldType|FieldDrive`1|T}}|TypeAdv0=true|
|Target|{{RootFieldType|FieldDrive`1|T}}|TypeAdv0=true|A field which is driven with the currently selected
|Index|Int|
|Index|Int|0-based index that determines which value of <code>Values</code> has been selected; values outside the range <code>[0;length-1]</code> are wrapped around internally.
|Values|{{RootFieldType|SyncFieldList`1|T}}|TypeAdv2=true|
|Values|{{RootFieldType|SyncFieldList`1|T}}|TypeAdv2=true|A list of values which can also individually be driven or written to
|AllowWriteBack|Bool|
|AllowWriteBack|Bool|Setting this to <code>true</code> redirects writes to <code>Target</code> or to a <code>Source</code> representing the selected value to the currently indexed list entry.
}}
}}



Revision as of 14:30, 10 July 2024

Component image 
Value Multiplexer`1 component as seen in the Scene Inspector


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

Fields
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

Examples

See Also