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 as existing elements can be reassigned.
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:


public Void Add(MaterialAsset? item)

Summary: Throws NotSupportedException because the number of material slots cannot be dynamically increased.

Parameters:


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:

Returns:


public Void Insert(Int32 index, MaterialAsset? item)

Summary: Throws NotSupportedException because elements cannot be inserted into the fixed-size slot layout.

Parameters:


public Void RemoveAt(Int32 index)

Summary: Throws NotSupportedException because elements cannot be removed from the fixed-size slot layout.

Parameters:


public Boolean Contains(MaterialAsset? item)

Summary: Determines whether the collection contains a specific material asset.

Parameters:

Returns:


public Int32 IndexOf(MaterialAsset? item)

Summary: Determines the index of a specific material asset in the collection.

Parameters:

Returns:


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: