Class EventSystemExtensions
Extension methods for Unity's EventSystem
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit
Assembly: cs.temp.dll.dll
Syntax
public static class EventSystemExtensions
Methods
Raycast(EventSystem, PointerEventData, LayerMask[], RaycastResultComparer)
Executes a raycast all and returns the closest element. Fixes the current issue with Unity's raycast sorting which does not consider separate canvases.
Declaration
public static RaycastResult Raycast(this EventSystem eventSystem, PointerEventData pointerEventData, LayerMask[] layerMasks, RaycastResultComparer raycastResultComparer = null)
Parameters
Type | Name | Description |
---|---|---|
EventSystem | eventSystem | |
PointerEventData | pointerEventData | |
LayerMask[] | layerMasks | |
RaycastResultComparer | raycastResultComparer |
Returns
Type | Description |
---|---|
RaycastResult | RaycastResult if hit, or an empty RaycastResult if nothing was hit |
Remarks
Takes an optional RaycastResultComparer, which will be used to select the highest priority raycast result.
Raycast(EventSystem, PointerEventData, LayerMask[], RaycastResultComparer)
Executes a raycast all and returns the closest element. Fixes the current issue with Unity's raycast sorting which does not consider separate canvases.
Declaration
public static RaycastResult Raycast(this EventSystem eventSystem, PointerEventData pointerEventData, LayerMask[] layerMasks, RaycastResultComparer raycastResultComparer = null)
Parameters
Type | Name | Description |
---|---|---|
EventSystem | eventSystem | |
PointerEventData | pointerEventData | |
LayerMask[] | layerMasks | |
RaycastResultComparer | raycastResultComparer |
Returns
Type | Description |
---|---|
RaycastResult | RaycastResult if hit, or an empty RaycastResult if nothing was hit |
Remarks
Takes an optional RaycastResultComparer, which will be used to select the highest priority raycast result.