MeshMaterialCollection
Summary
Provides access to the collection of material assets assigned to a Mesh3DComponent.
Remarks
Danger
All calls made within this class MUST be performed on the Master Thread. See Threads.RunLater on how to safely call this from an asynchronous thread. Failure to comply with this can cause catastrophical failures as the engine is not designed for this.
Definition
Namespace: SDT4.Managed.Core.Components
Assembly: SDT4.Managed.Core.dll
struct MeshMaterialCollection
Implements:
IList<MaterialAsset>, ICollection<MaterialAsset>, IEnumerable<MaterialAsset>, IEnumerable
Fields
| Name | Type | Description |
|---|---|---|
Properties
| Name | Type | Description |
|---|---|---|
public get; Count |
Int32 | Gets the total number of material slots available on the owner mesh component. |
public get; IsReadOnly |
Boolean | Gets a value indicating whether this collection is read-only. Always returns |
public get; set; Item |
MaterialAsset? | Gets or sets the material asset assigned to the specified slot index. |
Methods
public IEnumerator<MaterialAsset> GetEnumerator()
Summary: Returns an enumerator that iterates through the collection of material assets.
Returns:
- IEnumerator<MaterialAsset>: An enumerator for the collection.
public Void Add(MaterialAsset? item)
Summary: Throws NotSupportedException because the number of material slots cannot be dynamically increased.
Parameters:
item(MaterialAsset?): The material asset to add.
public Void Clear()
Summary: Throws NotSupportedException because the collection size is fixed to the mesh's material slot count.
public Boolean Remove(MaterialAsset? item)
Summary: Throws NotSupportedException because the collection size is fixed to the mesh's material slot count.
Parameters:
item(MaterialAsset?): The material asset to remove.
Returns:
- Boolean: Never returns a value.
public Void Insert(Int32 index, MaterialAsset? item)
Summary: Throws NotSupportedException because elements cannot be inserted into the fixed-size slot layout.
Parameters:
-
index(Int32): The zero-based index at which to insert. -
item(MaterialAsset?): The material asset to insert.
public Void RemoveAt(Int32 index)
Summary: Throws NotSupportedException because elements cannot be removed from the fixed-size slot layout.
Parameters:
index(Int32): The zero-based index of the element to remove.
public Boolean Contains(MaterialAsset? item)
Summary: Determines whether the collection contains a specific material asset.
Parameters:
item(MaterialAsset?): The material asset to locate in the collection.
Returns:
- Boolean:
if itemis found; otherwise,.
public Int32 IndexOf(MaterialAsset? item)
Summary: Determines the index of a specific material asset in the collection.
Parameters:
item(MaterialAsset?): The material asset to locate.
Returns:
- Int32: The zero-based index of the first occurrence if found; otherwise,
-1 .
public Void CopyTo(MaterialAsset[] array, Int32 arrayIndex)
Summary: Copies the material assets of the collection to an array, starting at a particular array index.
Parameters:
-
array(MaterialAsset[]): The one-dimensional array that is the destination of the elements copied from the collection. -
arrayIndex(Int32): The zero-based index inarrayat which copying begins.