コード例 #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);
            }
        }
コード例 #2
0
        //-------------------------------------------------
        public static void HideTextHint(Hand hand, EVRButtonId button)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                hints.HideText(button);
            }
        }
コード例 #3
0
        //-------------------------------------------------
        public static void HideAllTextHints(Hand hand)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                hints.HideAllText();
            }
        }
コード例 #4
0
        //-------------------------------------------------
        public static void HideButtonHint(Hand hand, params EVRButtonId[] buttons)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                hints.HideButtonHint(buttons);
            }
        }
コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #7
0
        //-------------------------------------------------
        public static void HideTextHint(Hand hand, ISteamVR_Action_In_Source action)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

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

            justPickedUpItem = false;
        }
コード例 #9
0
        //-------------------------------------------------
        public static void HideButtonHint(Hand hand, params ISteamVR_Action_In_Source[] actions)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                hints.HideButtonHint(actions);
            }
        }
コード例 #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);
     }
 }
コード例 #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();
            }
        }
コード例 #12
0
ファイル: Throwable.cs プロジェクト: joshlvmh/Chroma
 //-------------------------------------------------
 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);
     }
 }
コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #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);
        }
コード例 #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);
     }
 }
コード例 #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);
            }
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #20
0
        //-------------------------------------------------
        public static bool IsButtonHintActive(Hand hand, EVRButtonId button)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

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

            return(false);
        }
コード例 #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();
            }
        }
コード例 #22
0
ファイル: UIElement.cs プロジェクト: DevZhav/The-Forest
 private void HandHoverUpdate(Hand hand)
 {
     if (hand.GetStandardInteractionButtonDown())
     {
         InputModule.instance.Submit(base.gameObject);
         ControllerButtonHints.HideButtonHint(hand, new EVRButtonId[]
         {
             EVRButtonId.k_EButton_Axis1
         });
     }
 }
コード例 #23
0
 public void CancelTeleportHint()
 {
     if (hintCoroutine != null)
     {
         ControllerButtonHints.HideTextHint(player.leftHand, teleportAction);
         ControllerButtonHints.HideTextHint(player.rightHand, teleportAction);
         StopCoroutine(hintCoroutine);
         hintCoroutine = null;
     }
     CancelInvoke("ShowTeleportHint");
 }
コード例 #24
0
ファイル: Throwable.cs プロジェクト: DevZhav/The-Forest
 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
         });
     }
 }
コード例 #25
0
        //-------------------------------------------------
        public void CancelTeleportHint()
        {
            if (hintCoroutine != null)
            {
                ControllerButtonHints.HideTextHint(player.hands[0], EVRButtonId.k_EButton_SteamVR_Touchpad);

                StopCoroutine(hintCoroutine);
                hintCoroutine = null;
            }

            CancelInvoke("ShowTeleportHint");
        }
コード例 #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);
 }
コード例 #27
0
ファイル: CircularDrive.cs プロジェクト: DevZhav/The-Forest
 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;
     }
 }
コード例 #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;
        }
コード例 #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);
        }
コード例 #30
0
ファイル: CircularDrive.cs プロジェクト: DevZhav/The-Forest
 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;
 }