|
Unity HDRP Product Visualizer 1.0.0
Interactive 3D product showcase built with Unity 6 and HDRP
|
Applies ProductVariant presets to a set of Renderers using MaterialPropertyBlock. More...


Public Member Functions | |
| void | NextVariant () |
| Advances to the next variant, wrapping around the list. | |
| void | PreviousVariant () |
| Steps back to the previous variant, wrapping around the list. | |
| void | SetVariantIndex (int index) |
| Jumps directly to a variant by index. | |
Public Attributes | |
| List< Renderer > | bodyRenderers = new() |
| Renderers whose material properties will be overridden. | |
| List< ProductVariant > | variants = new() |
| Ordered list of PBR colour presets available in the visualizer. | |
| System.Action< int, ProductVariant > | OnVariantChanged |
Fired after a variant change with (newIndex, newVariant). | |
Properties | |
| ProductVariant | CurrentVariant [get] |
The currently active ProductVariant, or null if the list is empty. | |
| int | CurrentIndex [get] |
| Zero-based index of the active variant. | |
| int | VariantCount [get] |
| Total number of registered variants. | |
| string | CurrentVariantName [get] |
| Display name of the active variant (empty string if none). | |
Applies ProductVariant presets to a set of Renderers using MaterialPropertyBlock.
This component is the colour-only counterpart to CanMaterialSwapper. Use it when the product mesh does not require texture swapping — for example, to quickly prototype colour options without authoring separate material assets.
Definition at line 51 of file ProductVariantController.cs.
| void ProductVariantController.NextVariant | ( | ) |
Advances to the next variant, wrapping around the list.
Definition at line 96 of file ProductVariantController.cs.
References OnVariantChanged, and variants.
| void ProductVariantController.PreviousVariant | ( | ) |
Steps back to the previous variant, wrapping around the list.
Definition at line 104 of file ProductVariantController.cs.
References OnVariantChanged, and variants.
| void ProductVariantController.SetVariantIndex | ( | int | index | ) |
Jumps directly to a variant by index.
| index | Zero-based index into variants. Out-of-range values are ignored. |
Definition at line 113 of file ProductVariantController.cs.
References OnVariantChanged, and variants.
| List<Renderer> ProductVariantController.bodyRenderers = new() |
Renderers whose material properties will be overridden.
Typically the main body mesh(es) of the product.
Definition at line 60 of file ProductVariantController.cs.
| System.Action<int, ProductVariant> ProductVariantController.OnVariantChanged |
Fired after a variant change with (newIndex, newVariant).
Definition at line 71 of file ProductVariantController.cs.
Referenced by NextVariant(), PreviousVariant(), and SetVariantIndex().
| List<ProductVariant> ProductVariantController.variants = new() |
Ordered list of PBR colour presets available in the visualizer.
Definition at line 64 of file ProductVariantController.cs.
Referenced by NextVariant(), PreviousVariant(), and SetVariantIndex().
|
get |
Zero-based index of the active variant.
Definition at line 125 of file ProductVariantController.cs.
|
get |
The currently active ProductVariant, or null if the list is empty.
Definition at line 122 of file ProductVariantController.cs.
|
get |
Display name of the active variant (empty string if none).
Definition at line 131 of file ProductVariantController.cs.
|
get |
Total number of registered variants.
Definition at line 128 of file ProductVariantController.cs.