The AssetMultiplexer component is used to drive a field to one asset from a list, based on its position in the list.
The '''AssetMultiplexer''' component is used to drive an asset field from a list of assets and an index within the list.
<!--T:2-->
<!--T:2-->
Line 19:
Line 20:
== Usage ==
== Usage ==
Add the list of assets you want to use through the SyncAssetList<IAsset`1> area, then add in your assets into the items. Then you can specify the field through the Target you wanna switch between different assets for. Changing the Index will change which asset the Target has in it.
Add the list of assets you want to use through the SyncAssetList<IAsset`1> area, then add in your assets into the items. Then you can specify the field through the Target you wanna switch between different assets for. Changing the Index will change which asset the Target has in it.
{{Note|This component directly drives a value, not a reference. Therefore, trying to combine it with other components using an [[Type:IAssetProvider|IAssetProvider]]<T> type, such as a [[Component:ReferenceMultiDriver|ReferenceMultiDriver]], will not work. To drive by reference and thus interop this component, use a [[Component:ReferenceMultiDriver|ReferenceMultiDriver]]<IAssetProvider<T>>|information}}
<!--T:4-->
<!--T:4-->
Latest revision as of 21:45, 16 June 2024
Component image
Asset Multiplexer`1 component as seen in the Scene Inspector
The AssetMultiplexer component is used to drive an asset field from a list of assets and an index within the list.
Add the list of assets you want to use through the SyncAssetList<IAsset`1> area, then add in your assets into the items. Then you can specify the field through the Target you wanna switch between different assets for. Changing the Index will change which asset the Target has in it.
This component directly drives a value, not a reference. Therefore, trying to combine it with other components using an IAssetProvider<T> type, such as a ReferenceMultiDriver, will not work. To drive by reference and thus interop this component, use a ReferenceMultiDriver<IAssetProvider<T>>
Examples
Using an asset multiplexer to allow your avatar to switch shirts via changing the texture, a pattern changer for a music visualizer.