Example #1
0
    private void OnSelectInteraction()
    {
        RaycastHit hit;

        if (Physics.Raycast(Camera.main.transform.position, Camera.main.transform.forward, out hit))
        {
            OnSelectObjectInteraction?.Invoke(hit.point);
        }
    }
Example #2
0
    private void OnTouchInteractionEnded(Touch touch)
    {
#if UNITY_ANDROID || UNITY_IOS
        var arRaycastHits = new List <ARRaycastHit>();

        if (arRaycastManager.Raycast(touch.position, arRaycastHits, UnityEngine.XR.ARSubsystems.TrackableType.PlaneEstimated) && arRaycastHits.Count > 0)
        {
            var hit = arRaycastHits[0];

            OnSelectObjectInteraction?.Invoke(hit.pose.position);
        }
#elif WINDOWS_UWP || UNITY_WSA
#endif
    }