EventSystemExtensions.Raycast Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Executes a raycast all and returns the closest element. Fixes the current issue with Unity's raycast sorting which does not consider separate canvases.
C#
public static UnityEngine.EventSystems.RaycastResult Raycast (this UnityEngine.EventSystems.EventSystem eventSystem, UnityEngine.EventSystems.PointerEventData pointerEventData, UnityEngine.LayerMask[] layerMasks, Microsoft.MixedReality.Toolkit.Physics.RaycastResultComparer raycastResultComparer = default);
static member Raycast : UnityEngine.EventSystems.EventSystem * UnityEngine.EventSystems.PointerEventData * UnityEngine.LayerMask[] * Microsoft.MixedReality.Toolkit.Physics.RaycastResultComparer -> UnityEngine.EventSystems.RaycastResult
<Extension()>
Public Function Raycast (eventSystem As EventSystem, pointerEventData As PointerEventData, layerMasks As LayerMask(), Optional raycastResultComparer As RaycastResultComparer = Nothing) As RaycastResult
- eventSystem
- UnityEngine.EventSystems.EventSystem
- pointerEventData
- UnityEngine.EventSystems.PointerEventData
- layerMasks
- UnityEngine.LayerMask[]
- raycastResultComparer
- RaycastResultComparer
UnityEngine.EventSystems.RaycastResult
RaycastResult if hit, or an empty RaycastResult if nothing was hit
Takes an optional RaycastResultComparer, which will be used to select the highest priority raycast result.
Ürün | Sürümler |
---|---|
MRTK2 Unity 2018 | 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0 |
MRTK2 Unity 2019 | 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0 |
MRTK2 Unity 2020 | 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0 |