Пример #1
0
    private void OnDetachedFromHand(Hand hand)
    {
        _grabbingObject = null;
        ControllerInteraction.ControllerHand handContext = hand.handType.GetHand();

        InteractableObjectUngrabbed?.Invoke(this,
                                            new ObjectInteraction.InteractableObjectEventArgs {
            interactingObject = gameObject, Hand = handContext
        });
    }
Пример #2
0
    private void OnAttachedToHand(Hand hand)
    {
        _grabbingObject = hand;
        ControllerInteraction.ControllerHand handContext = hand.handType.GetHand();

        InteractableObjectGrabbed?.Invoke(this,
                                          new ObjectInteraction.InteractableObjectEventArgs {
            interactingObject = gameObject, Hand = handContext
        });
        Debug.Log("attached to " + hand.handType);
    }
Пример #3
0
            public virtual ControllerNode GetControllerReference(ControllerInteraction.ControllerHand hand)
            {
                switch (hand)
                {
                case ControllerInteraction.ControllerHand.Left: return(LeftHand);

                case ControllerInteraction.ControllerHand.Right: return(RightHand);
                }

                return(null);
            }
Пример #4
0
    private void UseStop(SteamVR_Behaviour_Boolean triggerInput, SteamVR_Input_Sources sources, bool state)
    {
        if (!_isUsing)
        {
            return;
        }

        Debug.Log("Use unpressed");

        _isUsing = false;

        ControllerInteraction.ControllerHand handContext = triggerInput.booleanAction.activeDevice.GetHand();

        InteractableObjectUnused?.Invoke(this,
                                         new ObjectInteraction.InteractableObjectEventArgs {
            interactingObject = gameObject, Hand = handContext
        });
    }
Пример #5
0
    private void Use(SteamVR_Behaviour_Boolean triggerInput, SteamVR_Input_Sources sources, bool state)
    {
        if (!ValidInput(triggerInput))
        {
            return;
        }

        Debug.Log("Use pressed on " + gameObject.name);

        if (!IsUsable)
        {
            return;
        }

        _isUsing = true;

        ControllerInteraction.ControllerHand handContext = triggerInput.booleanAction.activeDevice.GetHand();

        InteractableObjectUsed?.Invoke(this,
                                       new ObjectInteraction.InteractableObjectEventArgs {
            interactingObject = gameObject, Hand = handContext
        });
        Debug.Log("Used " + gameObject.name);
    }
Пример #6
0
 public override string GetControllerElementPath(
     ControllerInteraction.ControllerElements findElement,
     ControllerInteraction.ControllerHand controllerHand,
     bool b) => throw new NotImplementedException();
Пример #7
0
 public abstract string GetControllerElementPath(
     ControllerInteraction.ControllerElements findElement,
     ControllerInteraction.ControllerHand controllerHand,
     bool b);