Пример #1
0
 /// <summary>
 /// Event called when the user is clicking on something
 /// </summary>
 /// <param name="startClickingEvent">The event raised when an object was clicked</param>
 private void CheckClickedObject(OnVRClickerStartClicking startClickingEvent)
 {
     if (CheckGameObject(startClickingEvent.ClickedObject))
     {
         onClick.Invoke();
         UIHapticGenerator.CreateClickHapticSignal(startClickingEvent.RaycastOrigin);
     }
 }
Пример #2
0
 private void CheckHoveredObject(OnStartHoveringObject startHoveringEvent)
 {
     if (CheckGameObject(startHoveringEvent.HoveredObject))
     {
         OnHover.Invoke();
         UIHapticGenerator.CreateClickHapticSignal(startHoveringEvent.RaycastOrigin);
     }
 }
Пример #3
0
        private void OnTriggerEnter(Collider other)
        {
            var objectTag = other.gameObject.tag;

            if (ControllerClickable && interactable && (objectTag.Contains("ControllerBody") || objectTag.Contains("UIClicker")))
            {
                onClick.Invoke();
                UIHapticGenerator.CreateClickHapticSignal(other.name.ToLower().Contains("left") ? Core.Raycast.ERayOrigin.LEFT_HAND : Core.Raycast.ERayOrigin.RIGHT_HAND);
            }
        }
Пример #4
0
        /// <summary>
        /// Check which hand is pointing toward the slider
        /// </summary>
        private void HandleHandInteracting(ERayOrigin handPointing)
        {
            if (_isFilling)
            {
                return;
            }

            _handFilling = handPointing;
            _isFilling   = true;
            UIHapticGenerator.CreateClickHapticSignal(handPointing);
        }
Пример #5
0
 /// <summary>
 /// Event called when the user is clicking on something
 /// </summary>
 /// <param name="startClickingEvent">The event raised when an object was clicked</param>
 private void CheckClickedObject(OnVRClickerStartClicking startClickingEvent)
 {
     if (interactable && startClickingEvent.ClickedObject == gameObject)
     {
         StartTyping();
         UIHapticGenerator.CreateClickHapticSignal(startClickingEvent.RaycastOrigin);
     }
     else
     {
         m_CaretVisible = false;
     }
 }
Пример #6
0
        private void OnTriggerEnter(Collider other)
        {
            if (!ControllerClickable || !interactable)
            {
                return;
            }

            if (other.gameObject.CompareTag("ControllerBody") || other.gameObject.CompareTag("UIClicker"))
            {
                SetDropDownNewState();
                UIHapticGenerator.CreateClickHapticSignal(other.name.ToLower().Contains("left") ? Core.Raycast.ERayOrigin.LEFT_HAND : Core.Raycast.ERayOrigin.RIGHT_HAND);
            }
        }
Пример #7
0
        /// <summary>
        /// Event called when the user is clicking on something
        /// </summary>
        /// <param name="startClickingEvent">The event raised when an object was clicked</param>
        private void CheckClickedObject(OnVRClickerStartClicking startClickingEvent)
        {
            if (CanHoldHandle())
            {
                _rayHoldingHandle = startClickingEvent.RaycastOrigin;
                UIHapticGenerator.CreateClickHapticSignal(_rayHoldingHandle);
            }

            bool CanHoldHandle()
            {
                return(interactable && startClickingEvent.ClickedObject == gameObject && _rayHoldingHandle == ERayOrigin.NONE);
            }
        }