Component:MaterialSet

From Resonite Wiki
(Redirected from MaterialSet (Component))


This article or section is a Stub. You can help the Resonite Wiki by expanding it.


Component image 
Material Set component as seen in the Scene Inspector

Material set allows for switching the list of materials being used on a mesh dynamically at any given moment. It also allows for lengthening or shortening the list in real time, which can be used to material stack (things to avoid).

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.
ActiveSetIndex Int The index into the Sets list of the materials to apply to the target renderer.
Target direct DriveRef`1<SyncAssetList`1<Material>> The list of materials in a renderer to swap out.
Sets list of SyncAssetList`1<Material> The list of lists of materials in a renderer to swap out.

Usage

Attach this component to the same slot as a Mesh Renderer or a Skinned Mesh Renderer and hit the Setup From Mesh Renderer() sync delegate to attach it to the material list. Next add a list (SyncAssetList`1<Material>) of each material list to Sets you want to switch between. Lastly use ActiveSetIndex to switch between each list in Sets for Target.

Examples

Can be used to switch a material set on an avatar to make them change material types (toon to pbs metallic) or from active camo to not active camo, etc.