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); }
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); }