Component:AssetMultiplexer: Difference between revisions

From Resonite Wiki
m ProbablePrime moved page AssetMultiplexer (Component) to Component:AssetMultiplexer: Creating component Namespace
add info, no longer stub
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
{{stub}}
{{Infobox Component
{{Infobox Component
|Image=AssetMultiplexer`1Component.png
|Image=AssetMultiplexer`1Component.png
|Name=Asset Multiplexer`1
|Name=Asset Multiplexer`1
}}
}}
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 a field to one asset from a list, based on its position in the list.


Line 13: Line 11:
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|Target|AssetRef`1|TypeString0=AssetRef<ITexture2D>| The field to drive.
|Target|AssetRef`1|TypeString0=AssetRef<IAsset`1>| The field to drive.
|Index|Int| Which element in <code>Assets</code> to drive to <code>Target</code>
|Index|Int| Which element in <code>Assets</code> to drive to <code>Target</code>
|Assets|SyncAssetList`1|TypeString2=SyncAssetList<ITexture2D>| The list of assets to multiplex between.
|Assets|Asset`1|TypeString2=SyncAssetList<IAsset`1>| The list of assets to multiplex between.
}}
}}


<!--T:3-->
<!--T:3-->
== 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.


<!--T:4-->
<!--T:4-->
== Examples ==
== Examples ==
 
Using an asset multiplexer to allow your avatar to switch shirts via changing the texture, a pattern changer for a music visualizer.
== Related Issues == <!--T:5-->
[https://github.com/Neos-Metaverse/NeosPublic/issues/247 #247 - Allow importing a complete directory into a AssertMultiplexer]


<!--T:6-->
<!--T:6-->
== Related Components ==
== Related Components ==
</translate>
</translate>
[[Category:ComponentStubs]]
[[Category:Generics{{#translation:}}]]
[[Category:Generics{{#translation:}}]]
[[Category:Components{{#translation:}}|Asset Multiplexer`1]]
[[Category:Components{{#translation:}}|Asset Multiplexer`1]]
[[Category:Components:Assets:Utility{{#translation:}}|Asset Multiplexer`1]]
[[Category:Components:Assets:Utility{{#translation:}}|Asset Multiplexer`1]]

Revision as of 03:31, 14 February 2024

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

The AssetMultiplexer component is used to drive a field to one asset from a list, based on its position in the list.

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.
Target AssetRef<IAsset`1> The field to drive.
Index Int Which element in Assets to drive to Target
Assets SyncAssetList<IAsset`1> The list of assets to multiplex between.

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.

Examples

Using an asset multiplexer to allow your avatar to switch shirts via changing the texture, a pattern changer for a music visualizer.

Related Components