using System.Collections.Generic; using UnityEngine.EventSystems; namespace UnityEngine.XR.Interaction.Toolkit.UI { /// /// A custom UI event for devices that exist within 3D Unity space, separate from the camera's position. /// public class TrackedDeviceEventData : PointerEventData { /// /// Initializes and returns an instance of with event system. /// /// The event system associated with the UI. public TrackedDeviceEventData(EventSystem eventSystem) : base(eventSystem) { } /// /// A series of interconnected points Unity uses to track hovered and selected UI. /// public List rayPoints { get; set; } /// /// Set by the ray caster, this is the index of the endpoint within the list that received the hit. /// public int rayHitIndex { get; set; } /// /// The physics layer mask to use when checking for hits, both in occlusion and UI objects. /// public LayerMask layerMask { get; set; } /// /// (Read Only) The Interactor that triggered this event, or if no interactor was responsible. /// public IUIInteractor interactor { get { var xrInputModule = currentInputModule as XRUIInputModule; if (xrInputModule != null) { return xrInputModule.GetInteractor(pointerId); } return null; } } /// /// The position in world space that this button was last pressed. /// This is used to recalculate the relative screen space during head movement. /// /// internal Vector3 pressWorldPosition { get; set; } } }