Added details to match ValueMultiplexer (as far as similarities go)
Line 3:
Line 3:
|Name=Reference Multiplexer`1
|Name=Reference Multiplexer`1
}}
}}
{{stub}}
ReferenceMultiplexers allow to curate a list of references and [[Drive|drive]] a target with one of them.
Unlike [[Component:ValueMultiplexer|ValueMultiplexers]] they don't implement [[Type:IValue`1|IValue]] and therefore can't be accessed directly within ProtoFlux.
|Target|{{RootFieldType|RefDrive`1|T}}|TypeAdv0=true|A [[Type:SyncRef`1|SyncRef]] which is driven with the currently selected reference
|Index|Int|
|Index|Int|0-based index that determines which reference of <code>References</code> has been selected; values outside the range <code>[0;length-1]</code> are wrapped around internally.
|References|{{RootFieldType|SyncRefList`1|T}}|TypeAdv2=true|A list of references which can also individually be driven or written to
|AllowWriteBack|Bool|
|AllowWriteBack|Bool|Setting this to <code>true</code> redirects writes from <code>Target</code> to the currently indexed list entry.
}}
}}
== Behavior ==
== Behavior ==
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.
== Examples ==
== Examples ==
Latest revision as of 17:09, 10 July 2024
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.
Setting this to true redirects writes from Target to the currently indexed list entry.
Behavior
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.