Class XRTintInteractableVisual
Simple Interactable Visual component that demonstrates hover or selection state with emissive tinting. Note: requires use of a shader that supports emission (such as Standard shader) with the variant included in the game build.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
[AddComponentMenu("XR/Visual/XR Tint Interactable Visual", 11)]
[DisallowMultipleComponent]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.0/api/UnityEngine.XR.Interaction.Toolkit.XRTintInteractableVisual.html")]
public class XRTintInteractableVisual : MonoBehaviour
Properties
tintColor
The tint color for interactable.
Declaration
public Color tintColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
tintOnHover
Whether this should tint on hover.
Declaration
public bool tintOnHover { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
tintOnSelection
Whether this should tint on selection.
Declaration
public bool tintOnSelection { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
tintRenderers
The Renderer(s) to use for tinting (will default to any Renderer on the GameObject if not specified).
Declaration
public List<Renderer> tintRenderers { get; set; }
Property Value
Type | Description |
---|---|
List<Renderer> |
Methods
Awake()
See MonoBehaviour.
Declaration
protected void Awake()
GetEmissionEnabled()
Gets whether all shared materials on the Renderers used for tinting have emission enabled.
Declaration
protected virtual bool GetEmissionEnabled()
Returns
Type | Description |
---|---|
Boolean | Returns true if all materials used for tinting have emission enabled. Otherwise, returns false. |
OnDestroy()
See MonoBehaviour.
Declaration
protected void OnDestroy()
SetTint(Boolean)
Apply or remove a tint to all Renderers used for tinting.
Declaration
protected virtual void SetTint(bool on)
Parameters
Type | Name | Description |
---|---|---|
Boolean | on | Whether to apply a tint when true, or remove the tint when false. |