Method TryGetCurrentRaycast
TryGetCurrentRaycast(out RaycastHit?, out int, out RaycastResult?, out int, out bool)
Gets the first 3D and UI ray cast hits, if any ray cast hits are available.
Declaration
public bool TryGetCurrentRaycast(out RaycastHit? raycastHit, out int raycastHitIndex, out RaycastResult? uiRaycastHit, out int uiRaycastHitIndex, out bool isUIHitClosest)
Parameters
| Type | Name | Description |
|---|---|---|
| RaycastHit? | raycastHit | When this method returns, contains the ray cast hit if available; otherwise, the default value. |
| int | raycastHitIndex | When this method returns, contains the index of the sample endpoint if a hit occurred.
Otherwise, a value of |
| RaycastResult? | uiRaycastHit | When this method returns, contains the UI ray cast result if available; otherwise, the default value. |
| int | uiRaycastHitIndex | When this method returns, contains the index of the sample endpoint if a hit occurred.
Otherwise, a value of |
| bool | isUIHitClosest | When this method returns, contains whether the UI ray cast result was the closest hit. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if either hit occurred, implying the ray cast hit information is valid. Otherwise, returns false. |
TryGetCurrentRaycast(out RaycastHit?, out int, out RaycastResult?, out int, out bool, out ARRaycastHit?, out int, out bool)
Gets the first 3D, AR and UI ray cast hits, if any ray cast hits are available.
Declaration
public bool TryGetCurrentRaycast(out RaycastHit? raycastHit, out int raycastHitIndex, out RaycastResult? uiRaycastHit, out int uiRaycastHitIndex, out bool isUIHitClosest, out ARRaycastHit? arRaycastHit, out int arRaycastHitIndex, out bool isARHitClosest)
Parameters
| Type | Name | Description |
|---|---|---|
| RaycastHit? | raycastHit | When this method returns, contains the ray cast hit if available; otherwise, the default value. |
| int | raycastHitIndex | When this method returns, contains the index of the sample endpoint if a hit occurred.
Otherwise, a value of |
| RaycastResult? | uiRaycastHit | When this method returns, contains the UI ray cast result if available; otherwise, the default value. |
| int | uiRaycastHitIndex | When this method returns, contains the index of the sample endpoint if a hit occurred.
Otherwise, a value of |
| bool | isUIHitClosest | When this method returns, contains whether the UI ray cast result was the closest hit. |
| ARRaycastHit? | arRaycastHit | When this method returns, contains the AR ray cast hit if available; otherwise, the default value. |
| int | arRaycastHitIndex | When this method returns, contains the index of the sample endpoint if a hit occurred.
Otherwise, a value of |
| bool | isARHitClosest | When this method returns, contains whether the AR ray cast result was the closest hit. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if either hit occurred, implying the ray cast hit information is valid. Otherwise, returns false. |