Exemplo n.º 1
0
        // Token: 0x06002178 RID: 8568 RVA: 0x000A5434 File Offset: 0x000A3634
        public static void ShowButtonHint(Hand hand, params EVRButtonId[] buttons)
        {
            ControllerButtonHints controllerButtonHints = ControllerButtonHints.GetControllerButtonHints(hand);

            if (controllerButtonHints != null)
            {
                controllerButtonHints.ShowButtonHint(buttons);
            }
        }
Exemplo n.º 2
0
        //-------------------------------------------------
        public static void HideTextHint(Hand hand, EVRButtonId button)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                hints.HideText(button);
            }
        }
Exemplo n.º 3
0
        //-------------------------------------------------
        public static void HideAllTextHints(Hand hand)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                hints.HideAllText();
            }
        }
Exemplo n.º 4
0
        //-------------------------------------------------
        public static void HideButtonHint(Hand hand, params EVRButtonId[] buttons)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                hints.HideButtonHint(buttons);
            }
        }
Exemplo n.º 5
0
        //-------------------------------------------------
        public static void ShowTextHint(Hand hand, EVRButtonId button, string text, bool highlightButton = true)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                hints.ShowText(button, text, highlightButton);
            }
        }
Exemplo n.º 6
0
        //-------------------------------------------------
        public static void ShowTextHint(Hand hand, ISteamVR_Action_In_Source action, string text, bool highlightButton = true)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                hints.ShowText(action, text, highlightButton);
            }
        }
Exemplo n.º 7
0
        //-------------------------------------------------
        public static void HideTextHint(Hand hand, ISteamVR_Action_In_Source action)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                hints.HideText(action);
            }
        }
Exemplo n.º 8
0
        //-------------------------------------------------
        private void OnHandHoverEnd(Hand hand)
        {
            if (!justPickedUpItem && requireTriggerPressToTake && showTriggerHint)
            {
                ControllerButtonHints.HideTextHint(hand, Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger);
            }

            justPickedUpItem = false;
        }
Exemplo n.º 9
0
        //-------------------------------------------------
        public static void HideButtonHint(Hand hand, params ISteamVR_Action_In_Source[] actions)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                hints.HideButtonHint(actions);
            }
        }
Exemplo n.º 10
0
 //-------------------------------------------------
 private void HandHoverUpdate(Hand hand)
 {
     //Trigger got pressed
     if (hand.GetStandardInteractionButtonDown())
     {
         hand.AttachObject(gameObject, attachmentFlags, attachmentPoint);
         ControllerButtonHints.HideButtonHint(hand, Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger);
     }
 }
Exemplo n.º 11
0
        // Token: 0x0600217A RID: 8570 RVA: 0x000A547C File Offset: 0x000A367C
        public static void HideAllButtonHints(Hand hand)
        {
            ControllerButtonHints controllerButtonHints = ControllerButtonHints.GetControllerButtonHints(hand);

            if (controllerButtonHints != null)
            {
                controllerButtonHints.HideAllButtonHints();
            }
        }
Exemplo n.º 12
0
 //-------------------------------------------------
 private void HandHoverUpdate(Hand hand)
 {
     //Trigger got pressed
     if ((ViveInput.GetPressDown(HandRole.LeftHand, ControllerButton.Trigger)))
     {
         hand.AttachObject(gameObject, attachmentFlags, attachmentPoint);
         ControllerButtonHints.HideButtonHint(hand, Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger);
     }
 }
Exemplo n.º 13
0
        //-------------------------------------------------
        protected virtual void HandHoverUpdate(Hand hand)
        {
            Debug.Log("Hovered Updated");

            if (hand.uiInteractAction != null && hand.uiInteractAction.GetStateDown(hand.handType))
            {
                InputModule.instance.Submit(gameObject);
                ControllerButtonHints.HideButtonHint(hand, hand.uiInteractAction);
            }
        }
Exemplo n.º 14
0
        //-------------------------------------------------
        public static void ShowButtonHint(BNG.Grabber hand, params ISteamVR_Action_In_Source[] actions)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                Debug.LogError("Hints");
                hints.ShowButtonHint(actions);
            }
        }
Exemplo n.º 15
0
        public static string GetActiveHintText(Hand hand, EVRButtonId button)
        {
            ControllerButtonHints controllerButtonHints = ControllerButtonHints.GetControllerButtonHints(hand);

            if (controllerButtonHints != null)
            {
                return(controllerButtonHints.GetActiveHintText(button));
            }
            return(string.Empty);
        }
Exemplo n.º 16
0
 //-------------------------------------------------
 protected virtual void HandHoverUpdate(Hand hand)
 {
     if (hand.uiInteractAction.GetStateDown(hand.handType))
     {
         Debug.Log("hand is interacting!!!!!!!!!!!!!!!!!!!!!");
         Debug.Log(InputModule.instance.gameObject.name);
         InputModule.instance.Submit(gameObject);
         ControllerButtonHints.HideButtonHint(hand, hand.uiInteractAction);
     }
 }
Exemplo n.º 17
0
        //-------------------------------------------------
        private IEnumerator TeleportHintCoroutine()
        {
            float prevBreakTime       = Time.time;
            float prevHapticPulseTime = Time.time;

            while (true)
            {
                bool pulsed = false;

                //Show the hint on each eligible hand
                foreach (Hand hand in player.hands)
                {
                    bool showHint      = IsEligibleForTeleport(hand);
                    bool isShowingHint = !string.IsNullOrEmpty(ControllerButtonHints.GetActiveHintText(hand, EVRButtonId.k_EButton_SteamVR_Touchpad));
                    if (showHint)
                    {
                        if (!isShowingHint)
                        {
                            ControllerButtonHints.ShowTextHint(hand, EVRButtonId.k_EButton_SteamVR_Touchpad, "Teleport");
                            ControllerButtonHints.ShowTextHint(hand, EVRButtonId.k_EButton_SteamVR_Trigger, "Grab");
                            prevBreakTime       = Time.time;
                            prevHapticPulseTime = Time.time;
                        }

                        if (Time.time > prevHapticPulseTime + 0.05f)
                        {
                            //Haptic pulse for a few seconds
                            pulsed = true;

                            //hand.controller.TriggerHapticPulse( 500 );
                        }
                    }
                    else if (!showHint && isShowingHint)
                    {
                        ControllerButtonHints.HideTextHint(hand, EVRButtonId.k_EButton_SteamVR_Touchpad);
                        ControllerButtonHints.HideTextHint(hand, EVRButtonId.k_EButton_SteamVR_Trigger);
                    }
                }

                if (Time.time > prevBreakTime + 3.0f)
                {
                    //Take a break for a few seconds
                    yield return(new WaitForSeconds(3.0f));

                    prevBreakTime = Time.time;
                }

                if (pulsed)
                {
                    prevHapticPulseTime = Time.time;
                }

                yield return(null);
            }
        }
Exemplo n.º 18
0
        //-------------------------------------------------
        public static bool IsButtonHintActive(Hand hand, ISteamVR_Action_In_Source action)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                return(hints.IsButtonHintActive(action));
            }

            return(false);
        }
Exemplo n.º 19
0
        //-------------------------------------------------
        public static string GetActiveHintText(Hand hand, ISteamVR_Action_In_Source action)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                return(hints.GetActiveHintText(action));
            }

            return(string.Empty);
        }
Exemplo n.º 20
0
        //-------------------------------------------------
        public static bool IsButtonHintActive(Hand hand, EVRButtonId button)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                return(hints.IsButtonHintActive(button));
            }

            return(false);
        }
Exemplo n.º 21
0
        //-------------------------------------------------
        protected virtual void HandHoverUpdate(Hand hand)
        {
            GrabTypes startingGrabType = hand.GetGrabStarting();

            if (startingGrabType != GrabTypes.None)
            {
                hand.AttachObject(gameObject, startingGrabType, attachmentFlags, attachmentOffset);
                ControllerButtonHints.HideButtonHint(hand, hand.uiInteractAction);
                //hand.HideGrabHint();
            }
        }
Exemplo n.º 22
0
 private void HandHoverUpdate(Hand hand)
 {
     if (hand.GetStandardInteractionButtonDown())
     {
         InputModule.instance.Submit(base.gameObject);
         ControllerButtonHints.HideButtonHint(hand, new EVRButtonId[]
         {
             EVRButtonId.k_EButton_Axis1
         });
     }
 }
Exemplo n.º 23
0
 public void CancelTeleportHint()
 {
     if (hintCoroutine != null)
     {
         ControllerButtonHints.HideTextHint(player.leftHand, teleportAction);
         ControllerButtonHints.HideTextHint(player.rightHand, teleportAction);
         StopCoroutine(hintCoroutine);
         hintCoroutine = null;
     }
     CancelInvoke("ShowTeleportHint");
 }
Exemplo n.º 24
0
 private void HandHoverUpdate(Hand hand)
 {
     if (hand.GetStandardInteractionButtonDown())
     {
         hand.AttachObject(base.gameObject, this.attachmentFlags, this.attachmentPoint);
         ControllerButtonHints.HideButtonHint(hand, new EVRButtonId[]
         {
             EVRButtonId.k_EButton_Axis1
         });
     }
 }
        //-------------------------------------------------
        public void CancelTeleportHint()
        {
            if (hintCoroutine != null)
            {
                ControllerButtonHints.HideTextHint(player.hands[0], EVRButtonId.k_EButton_SteamVR_Touchpad);

                StopCoroutine(hintCoroutine);
                hintCoroutine = null;
            }

            CancelInvoke("ShowTeleportHint");
        }
Exemplo n.º 26
0
 private static ControllerButtonHints GetControllerButtonHints(Hand hand)
 {
     if (hand != null)
     {
         ControllerButtonHints componentInChildren = hand.GetComponentInChildren <ControllerButtonHints>();
         if (componentInChildren != null && componentInChildren.initialized)
         {
             return(componentInChildren);
         }
     }
     return(null);
 }
Exemplo n.º 27
0
 private void OnDisable()
 {
     if (this.handHoverLocked)
     {
         ControllerButtonHints.HideButtonHint(this.handHoverLocked, new EVRButtonId[]
         {
             EVRButtonId.k_EButton_Axis1
         });
         this.handHoverLocked.HoverUnlock(base.GetComponent <Interactable>());
         this.handHoverLocked = null;
     }
 }
Exemplo n.º 28
0
        //-------------------------------------------------
        private void OnHandHoverEnd(Hand hand)
        {
            ControllerButtonHints.HideButtonHint(hand, Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger);

            if (driving && hand.GetStandardInteractionButton())
            {
                StartCoroutine(HapticPulses(hand.controller, 1.0f, 10));
            }

            driving         = false;
            handHoverLocked = null;
        }
Exemplo n.º 29
0
        //-------------------------------------------------
        // These are the static functions which are used to show/hide the hints
        //-------------------------------------------------

        //-------------------------------------------------
        private static ControllerButtonHints GetControllerButtonHints(Hand hand)
        {
            if (hand != null)
            {
                ControllerButtonHints hints = hand.GetComponentInChildren <ControllerButtonHints>();
                if (hints != null && hints.initialized)
                {
                    return(hints);
                }
            }

            return(null);
        }
Exemplo n.º 30
0
 private void OnHandHoverEnd(Hand hand)
 {
     ControllerButtonHints.HideButtonHint(hand, new EVRButtonId[]
     {
         EVRButtonId.k_EButton_Axis1
     });
     if (this.driving && hand.GetStandardInteractionButton())
     {
         base.StartCoroutine(this.HapticPulses(hand.controller, 1f, 10));
     }
     this.driving         = false;
     this.handHoverLocked = null;
 }