Component:ReferenceMultiplexer: Difference between revisions

From Resonite Wiki
Added details to match ValueMultiplexer (as far as similarities go)
headers
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:
Unlike [[Component:ValueMultiplexer|ValueMultiplexers]] they don't implement [[Type:IValue`1|IValue]] and therefore can't be accessed directly within ProtoFlux.
Unlike [[Component:ValueMultiplexer|ValueMultiplexers]] they don't implement [[Type:IValue`1|IValue]] and therefore can't be accessed directly within ProtoFlux.


== Usage ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|Target|{{RootFieldType|RefDrive`1|T}}|TypeAdv0=true|A [[Type:SyncRef`1|SyncRef]] which is driven with the currently selected reference
|Target|{{RootFieldType|RefDrive`1|T}}|TypeAdv0=true|A [[Type:SyncRef`1|SyncRef]] which is driven with the currently selected reference
Line 15: Line 15:
}}
}}


== Behavior ==
== Usage ==
The component behaves similar to a [[Component:ReferenceCopy|ReferenceCopy]] with the list entry indicated by <code>Index</code> as its <code>Source</code>.
The component behaves similar to a [[Component:ReferenceCopy|ReferenceCopy]] 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.
Changes to <code>Index</code> or the list entries will affect <code>Target</code> whenever the drive is evaluated.
Line 26: Line 26:
[[Category:Components{{#translation:}}|Reference Multiplexer`1]]
[[Category:Components{{#translation:}}|Reference Multiplexer`1]]
[[Category:Generic Components{{#translation:}}|Reference Multiplexer`1]]
[[Category:Generic Components{{#translation:}}|Reference Multiplexer`1]]
[[Category:ComponentStubs]]

Latest revision as of 11:33, 5 July 2025

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

ReferenceMultiplexers allow to curate a list of references and drive a target with one of them.

Unlike ValueMultiplexers they don't implement IValue and therefore can't be accessed directly within ProtoFlux.

Fields

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. Some components stop their functionality when this field is disabled, but some don't.
Target direct RefDrive`1<T> A SyncRef which is driven with the currently selected reference
Index Int 0-based index that determines which reference of References has been selected; values outside the range [0;length-1] are wrapped around internally.
References list of T A list of references which can also individually be driven or written to
AllowWriteBack Bool Setting this to true redirects writes from Target to the currently indexed list entry.

Usage

The component behaves similar to a ReferenceCopy 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.

Examples

See Also