Exemple #1
0
 protected void UpdateHandRetracting(DHUI_HoverEventArgs _hoverEventArgs)
 {
     if (handRetracting)
     {
         float dist = StaticContactPlane.GetDistance(_hoverEventArgs.InteractorPhysicalPosition);
         if (internal_touchableState != TouchableInternalStates.Touch && ((Time.time >= lastTouchedUp + _maxRetractionTime) || dist >= _retargetingActivationDistance))
         {
             handRetracting = false;
             OnRetractionEnd?.Invoke(_hoverEventArgs);
         }
     }
 }
Exemple #2
0
        protected virtual void UpdateTouchableStates(DHUI_HoverEventArgs _hoverEvent)
        {
            float dist = StaticContactPlane.GetDistance(_hoverEvent.InteractorVirtualPosition);

            if (dist <= _touchThreshold)
            {
                TouchableInternalState = TouchableInternalStates.Touch;
            }
            else if (dist <= _nearTouchThreshold)
            {
                TouchableInternalState = TouchableInternalStates.NearTouch;
            }
            else
            {
                TouchableInternalState = TouchableInternalStates.Hover;
            }
        }