Class MaterialController
- Namespace
- Interaction
Handles material related functionality for TrainAR objects.
public class MaterialController : MonoBehaviour
- Inheritance
-
objectMaterialController
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
CombinedWithstring
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
colorColor?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
gameObjectGameObjectThe gameobject where the material is changed.
newMaterialMaterialThe new material.