MaterialKeys

Description

sealed class Tinman.Terrain.Util.MaterialKeys

Derived from

IConfigurable

A collection of color-key based material mappings.

Public / Constructors

Distinct


public static method Distinct → ()

returns → MaterialKeys

The material keys.

Creates a new instance of MaterialKeys that uses distinct color keys for each material.

See also

Colors.Distinct

MaterialKeys


public constructor MaterialKeys → (1)

defaultMaterial opt : int64 = 0

The default material.

Creates a new instance of MaterialKeys.

Public / Methods

Add


public method Add → (1)

materialKey in : MaterialKey

The material key.

returns → MaterialKeys

this

Adds a material key, replacing the existing material key, if present.

ToColor


public method ToColor → (1)

token in : int64

The material token.

returns → int64

The color key.

Returns the color key of the given material.

ToMaterial


public method ToMaterial → (1)

color in : int64

The color key.

returns → int64

The material token.

Returns the material token for the given color key.

Public / Attributes

DefaultMaterial


public attribute DefaultMaterial → (get)

value : int64

The default material token.

The default material token to use if no material keys match.

Defaults to material 0.

Configuration

Config


public static attribute Config → (get)

value : IConfigurator<MaterialKeys>

[not-null]
The configurator object.

The configurator object for this type.