private void Update()
        {
            if (!_planeManager.enabled)
            {
                return;
            }

            if (!ARFoundationExtensions.IsLookingAtPlane(_raycastManager, _planeManager,
                                                         out var lookingAtPose, out var lookingAtPlane))
            {
                return;
            }

            PlaneUpdated?.Invoke(lookingAtPose, lookingAtPlane);

            if (!InputManager.GetInputDown(ref _currentFingerId) || EventSystem.current &&
                _currentFingerId.HasValue && EventSystem.current.IsPointerOverGameObject(_currentFingerId.Value))

            {
                return;
            }

            if (ARFoundationExtensions.HasTouchedPlane(_raycastManager, _planeManager, out var touchPose,
                                                       out var touchPlane))
            {
                PlaneTouchedWithTouchPosition?.Invoke(touchPose, touchPlane);
            }

            PlaneTouchedWithLookingAtPosition?.Invoke(lookingAtPose, lookingAtPlane);
        }
Beispiel #2
0
        private void Update()
        {
            if (!planeManager.enabled || DistanceUpdate == null)
            {
                return;
            }

            var planeVisible = ARFoundationExtensions.IsLookingAtPlane(raycastManager, planeManager, out var pose);

            var distanceFromPlane = sessionOrigin.camera.transform.position - pose.position;

            DistanceUpdate?.Invoke(planeVisible, Mathf.Abs(distanceFromPlane.magnitude));
        }
Beispiel #3
0
        private void Update()
        {
            if (!planeManager.enabled)
            {
                return;
            }

            var planeVisible = ARFoundationExtensions.IsLookingAtPlane(raycastManager, planeManager, out var lookingAtPose, out var lookingAtPlane);

            PlaneUpdated?.Invoke(planeVisible, lookingAtPose, lookingAtPlane);

            if (!InputManager.GetInputDown(out var currentFingerId) || EventSystem.current?.IsPointerOverGameObject(currentFingerId) == true)
            {
                return;
            }

            if (ARFoundationExtensions.HasTouchedPlane(raycastManager, planeManager, out var touchPose, out var touchPlane))
            {
                PlaneTouchedWithTouchPosition?.Invoke(touchPose, touchPlane);
            }

            PlaneTouchedWithLookingAtPosition?.Invoke(lookingAtPose, lookingAtPlane);
        }
Beispiel #4
0
 public void SetActiveStateOfPlaneVisuals(bool activeState)
 {
     ARFoundationExtensions.SetActiveStateOfPlaneVisuals(activeState);
 }