Class MaterialGroup
Represents a group of materials associated with a model, providing indexed access and mapping functionality.
Inherited Members
Namespace: TriLibExporter.Objects
Assembly: Assembly-CSharp.dll
Syntax
public class MaterialGroup : ObjectBase
Constructors
MaterialGroup(AssetWriterContext, Material[])
Initializes a new instance of the MaterialGroup class.
Declaration
public MaterialGroup(AssetWriterContext assetWriterContext, Material[] materials)
Parameters
| Type | Name | Description |
|---|---|---|
| AssetWriterContext | assetWriterContext | The asset writer context associated with this material group. |
| Material[] | materials | The array of Unity materials to represent. |
Properties
Count
Gets the number of materials in the group.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
this[int]
Gets the material at the specified index.
Declaration
public Material this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The index of the material to retrieve. |
Property Value
| Type | Description |
|---|---|
| Material | The material at the specified index. |
Exceptions
| Type | Condition |
|---|---|
| IndexOutOfRangeException | Thrown if the index is out of range. |
Methods
LoadMaterial(AssetWriterContext, int, Dictionary<Material, Material>, Material)
Loads a material into the group, creating a new material or using an existing mapping.
Declaration
public Material LoadMaterial(AssetWriterContext assetWriterContext, int index, Dictionary<Material, Material> materialMapping, Material unityMaterial)
Parameters
| Type | Name | Description |
|---|---|---|
| AssetWriterContext | assetWriterContext | The asset writer context associated with this material. |
| int | index | The index at which to load the material. |
| Dictionary<Material, Material> | materialMapping | A dictionary mapping Unity materials to export-specific materials. |
| Material | unityMaterial | The Unity material to load. |
Returns
| Type | Description |
|---|---|
| Material | The loaded material. |