Ejemplo n.º 1
0
        protected virtual void UseUnHighlightObject(object sender, InteractableObjectEventArgs e)
        {
            VRTK_InteractableObject interactableObject = sender as VRTK_InteractableObject;

            if (interactableObject.IsGrabbed())
            {
                Highlight(grabHighlight);
                OnInteractObjectHighlighterHighlighted(SetEventArgs(VRTK_InteractableObject.InteractionType.Grab, e.interactingObject));
            }
            else if (interactableObject.IsTouched())
            {
                Highlight(touchHighlight);
                OnInteractObjectHighlighterHighlighted(SetEventArgs(VRTK_InteractableObject.InteractionType.Touch, e.interactingObject));
            }
            else if (interactableObject.IsNearTouched())
            {
                Highlight(nearTouchHighlight);
                OnInteractObjectHighlighterHighlighted(SetEventArgs(VRTK_InteractableObject.InteractionType.NearTouch, e.interactingObject));
            }
            else
            {
                Unhighlight();
                OnInteractObjectHighlighterUnhighlighted(SetEventArgs(VRTK_InteractableObject.InteractionType.Unuse, e.interactingObject));
            }
        }
Ejemplo n.º 2
0
 protected virtual void InteractableObjectUntouched(object sender, InteractableObjectEventArgs e)
 {
     if (IsValidInteractingObject(e.interactingObject, validTouchInteractingObject))
     {
         GameObject touchAffectedObject = (objectToAffect == null ? GetActualController(e.interactingObject) : objectToAffect);
         CancelRoutines(touchAffectedObject);
         touchingObjects.Remove(touchAffectedObject);
         if (objectToMonitor.IsNearTouched())
         {
             VRTK_SharedMethods.AddDictionaryValue(affectingRoutines, touchAffectedObject, StartCoroutine(ToggleStateAfterTime(touchAffectedObject, gameObjectActiveOnNearTouch, rendererVisibleOnNearTouch, untouchAppearanceDelay, VRTK_InteractableObject.InteractionType.NearTouch)), true);
         }
         else
         {
             VRTK_SharedMethods.AddDictionaryValue(affectingRoutines, touchAffectedObject, StartCoroutine(ToggleStateAfterTime(touchAffectedObject, gameObjectActiveByDefault, rendererVisibleByDefault, untouchAppearanceDelay, VRTK_InteractableObject.InteractionType.Untouch)), true);
         }
     }
 }