docs.unity3d.com
    Show / Hide Table of Contents

    Class TrackedDeviceGraphicRaycaster

    Custom implementation of GraphicRaycaster for XR Interaction Toolkit. This behavior is used to ray cast against a Canvas. The Raycaster looks at all Graphics on the canvas and determines if any of them have been hit by a ray from a tracked device.

    Inheritance
    Object
    UIBehaviour
    BaseRaycaster
    TrackedDeviceGraphicRaycaster
    Inherited Members
    BaseRaycaster.ToString()
    BaseRaycaster.OnEnable()
    BaseRaycaster.OnDisable()
    BaseRaycaster.OnCanvasHierarchyChanged()
    BaseRaycaster.OnTransformParentChanged()
    BaseRaycaster.priority
    BaseRaycaster.sortOrderPriority
    BaseRaycaster.renderOrderPriority
    BaseRaycaster.rootRaycaster
    UIBehaviour.Start()
    UIBehaviour.OnDestroy()
    UIBehaviour.IsActive()
    UnityEngine.EventSystems.UIBehaviour.OnValidate()
    UnityEngine.EventSystems.UIBehaviour.Reset()
    UIBehaviour.OnRectTransformDimensionsChange()
    UIBehaviour.OnBeforeTransformParentChanged()
    UIBehaviour.OnDidApplyAnimationProperties()
    UIBehaviour.OnCanvasGroupChanged()
    UIBehaviour.IsDestroyed()
    Namespace: UnityEngine.XR.Interaction.Toolkit.UI
    Syntax
    [AddComponentMenu("Event/Tracked Device Graphic Raycaster", 11)]
    [HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.0/api/UnityEngine.XR.Interaction.Toolkit.UI.TrackedDeviceGraphicRaycaster.html")]
    public class TrackedDeviceGraphicRaycaster : BaseRaycaster

    Properties

    blockingMask

    The layers of objects that are checked to determine if they block Graphic ray casts when checking for 2D or 3D occlusion.

    Declaration
    public LayerMask blockingMask { get; set; }
    Property Value
    Type Description
    LayerMask

    checkFor2DOcclusion

    Whether or not 2D occlusion is checked when performing ray casts. Enable to make Graphics be blocked by 2D objects that exist in front of it.

    Declaration
    public bool checkFor2DOcclusion { get; set; }
    Property Value
    Type Description
    Boolean
    Remarks

    This property has no effect when the project does not include the Physics 2D module.

    checkFor3DOcclusion

    Whether or not 3D occlusion is checked when performing ray casts. Enable to make Graphics be blocked by 3D objects that exist in front of it.

    Declaration
    public bool checkFor3DOcclusion { get; set; }
    Property Value
    Type Description
    Boolean

    eventCamera

    See BaseRaycaster.eventCamera.

    Declaration
    public override Camera eventCamera { get; }
    Property Value
    Type Description
    Camera
    Overrides
    BaseRaycaster.eventCamera

    ignoreReversedGraphics

    Whether Graphics facing away from the ray caster are checked for ray casts. Enable this to ignore backfacing Graphics.

    Declaration
    public bool ignoreReversedGraphics { get; set; }
    Property Value
    Type Description
    Boolean

    raycastTriggerInteraction

    Specifies whether the ray cast should hit Triggers when checking for 3D occlusion.

    Declaration
    public QueryTriggerInteraction raycastTriggerInteraction { get; set; }
    Property Value
    Type Description
    QueryTriggerInteraction

    Methods

    Awake()

    Declaration
    protected override void Awake()
    Overrides
    UIBehaviour.Awake()

    Raycast(PointerEventData, List<RaycastResult>)

    Performs a ray cast against objects within this Raycaster's domain.

    Declaration
    public override void Raycast(PointerEventData eventData, List<RaycastResult> resultAppendList)
    Parameters
    Type Name Description
    PointerEventData eventData

    Data containing where and how to ray cast.

    List<RaycastResult> resultAppendList

    The resultant hits from the ray cast.

    Overrides
    BaseRaycaster.Raycast(PointerEventData, List<RaycastResult>)
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023