MaterialArray

class MaterialArray : Iterable<Material>

A dynamic array of Material instances for a ModelComponent.

You can append or remove materials at the end of the array in addition to standard array operations.

Properties

Link copied to clipboard
val size: Int

Returns the number of materials in the array.

Functions

Link copied to clipboard
fun add(element: Material)

Appends a material to the end of this list.

fun add(elements: Array<out Material>)

Appends an array of materials to the end of this list.

Link copied to clipboard
operator fun get(index: Int): Material

Gets the material at the specified index from this component.

Link copied to clipboard
open operator override fun iterator(): Iterator<Material>

Creates an Iterator for iterating over the materials in the array.

Link copied to clipboard
operator fun plusAssign(element: Material)

Overloads the += operator to append a single material to the end of the array.

operator fun plusAssign(elements: Array<Material>)

Overloads the += operator to append an array of materials to the end of the array.

Link copied to clipboard

Removes and returns the last material in the array.

Link copied to clipboard
operator fun set(index: Int, material: Material)

Sets the material at the specified index for this component.

Link copied to clipboard
open override fun toString(): String