Class MaterialsVariantsMeshPrimitiveExtension
Mesh primitive level KHR_materials_variants extension.
Inherited Members
Namespace: Unity.Cloud.Gltfast.Objects
Assembly: Unity.Cloud.Gltfast.dll
Syntax
[MovedFrom(true, "GLTFast.Schema", "glTFast", null)]
public class MaterialsVariantsMeshPrimitiveExtension
Properties
Mappings
List of material to variants mapping.
Declaration
[JsonPropertyName("mappings")]
public List<MaterialVariantsMapping> Mappings { get; set; }
Property Value
| Type | Description |
|---|---|
| List<MaterialVariantsMapping> |
See Also
Methods
TryGetMaterialIndex(int, out int)
Retrieves the index of the material that corresponds to a material variant. If there's no match for this variant index, it returns false. In this case the default material has to be applied.
Declaration
public bool TryGetMaterialIndex(int variantIndex, out int materialIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| int | variantIndex | glTF materials variant index. |
| int | materialIndex | glTF material index. |
Returns
| Type | Description |
|---|---|
| bool | True if there's a matching mapping with the provided variant index. False otherwise. |