World Utilities / Applicators
Material Swap
Replaces materials on renderers while a boolean value is true.
| Component | Add Component menu / prefab | Source |
|---|---|---|
Simple Material Swap ApplicatorVRCTools.World.Values.Applicators.SimpleMaterialSwapApplicator
|
Values › Applicators › Simple Material Swap Applicator
|
SimpleMaterialSwapApplicator.cs ↗ |
Swaps one material slot per entry: while the boolean is true the slot uses the replacement material, while it is
false the slot uses the material it had when the world started.
Use material swaps when the two looks need different shaders or are easier to author as separate materials. If you only need to change a color or a number on the same shader, the Material Property applicator is cheaper and smoother.
Parameters
| Parameter | Default | Description |
|---|---|---|
| Type | LOCAL |
Kind of the source value. |
| Source | None | The boolean value to follow. Required. |
| Swaps | empty | List of Renderer, material Slot index and Replacement material. |
| Invert | false |
Advanced. Use the replacement while the value is false instead. |
The original material of each slot is captured when the applicator starts, so assign the “off” material on the renderer itself.
In v0.7.0 an entry only works correctly when its slot index equals its position in the
Swapslist (the first entry must target slot0, the second slot1, and so on). To swap slot2of a renderer, fill positions0and1with entries that “replace” those slots with the material they already use.