Esempio n. 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);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Event called when the DropDown or its children is clicked
 /// </summary>
 /// <param name="clickEvent">The event raised when an object is clicked</param>
 public void CheckClickedObject(OnVRClickerStartClicking clickEvent)
 {
     // if the clicked object is this one OR if it's something else and this dropdown was shown
     if (interactable && (clickEvent.ClickedObject == gameObject || _isShown))
     {
         SetDropDownNewState();
     }
 }
Esempio n. 3
0
 protected override void OnDestroy()
 {
     base.OnDestroy();
     if (OnVRClickerStartClicking.IsCallbackRegistered(CheckClickedObject))
     {
         OnVRClickerStartClicking.Listeners -= CheckClickedObject;
     }
 }
Esempio n. 4
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;
     }
 }
Esempio n. 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 (CanHoldHandle())
            {
                _rayHoldingHandle = startClickingEvent.RaycastOrigin;
                UIHapticGenerator.CreateClickHapticSignal(_rayHoldingHandle);
            }

            bool CanHoldHandle()
            {
                return(interactable && startClickingEvent.ClickedObject == gameObject && _rayHoldingHandle == ERayOrigin.NONE);
            }
        }
Esempio n. 6
0
        protected override void OnDestroy()
        {
            base.OnDestroy();

            if (OnVRClickerStartClicking.IsCallbackRegistered(CheckClickedObject))
            {
                OnVRClickerStartClicking.Listeners -= CheckClickedObject;
                OnVRClickerStopClicking.Listeners  -= CheckUnclickedObject;
            }
            else if (OnStartHoveringObject.IsCallbackRegistered(CheckHoveredObject))
            {
                OnStartHoveringObject.Listeners -= CheckHoveredObject;
                OnStopHoveringObject.Listeners  -= CheckUnhoveredObject;
            }
        }
Esempio n. 7
0
 /// <summary>
 /// Event called when the user is clicking on something
 /// </summary>
 /// <param name="startClickingEvent">The event raised when an object is clicked</param>
 private void CheckClickedObject(OnVRClickerStartClicking startClickingEvent)
 {
     CheckCanFillSlider(startClickingEvent.ClickedObject, startClickingEvent.RaycastOrigin);
 }