docs.unity.cn
    Show / Hide Table of Contents

    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.

    Inheritance
    Object
    XRTintInteractableVisual
    Namespace: UnityEngine.XR.Interaction.Toolkit
    Syntax
    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 (s) to use for tinting (will default to any on the if not specified).

    Declaration
    public List<Renderer> tintRenderers { get; set; }
    Property Value
    Type Description
    List<Renderer>

    Methods

    Awake()

    See .

    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 .

    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.

    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on Wednesday, October 27, 2021