Table of Contents

Class MaterialController

Namespace
Interaction

Handles material related functionality for TrainAR objects.

public class MaterialController : MonoBehaviour
Inheritance
object
MaterialController

Fields

DefaultHighlightColor

Default color of the highlight outline, used to point the user to an object (e.g. through the Object Helper node).

public static readonly Color DefaultHighlightColor

Field Value

Color

The TrainAR accent amber (#AD8C11), distinct from the selection, error and success colors.

Methods

ActivateErrorIndicator()

Play Error outline animation in coroutine.

public void ActivateErrorIndicator()

ActivateOutlines()

Activates the Outline of the object.

public void ActivateOutlines()

ActivateSuccessIndicator()

Play Success outline animation in coroutine.

public void ActivateSuccessIndicator()

ActivateSuccessIndicator(string)

Play Success outline animation in coroutine.

public void ActivateSuccessIndicator(string CombinedWith)

Parameters

CombinedWith string

ChangeToCombineMaterial()

Replaces all materials on the this Object with a material for combining.

public void ChangeToCombineMaterial()

DeactivateOutlines()

Deactivates the Outline of the object.

public void DeactivateOutlines()

SetHighlight(Color?)

Highlights the object with an outline to point the user to it, e.g. as the object to use in the current step. The highlight is removed automatically once the next action node completes successfully. Selection and feedback outlines take precedence while they are active.

public void SetHighlight(Color? color = null)

Parameters

color Color?

The highlight color, DefaultHighlightColor if null.

resetOriginalMaterial()

Resets the current materials back to original materials of the object.

public void resetOriginalMaterial()

setNewOriginalMaterial(GameObject, Material)

Change the original material of the given object with to a new material.

public void setNewOriginalMaterial(GameObject gameObject, Material newMaterial)

Parameters

gameObject GameObject

The gameobject where the material is changed.

newMaterial Material

The new material.