// 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); } }
//------------------------------------------------- public static void HideTextHint(Hand hand, EVRButtonId button) { ControllerButtonHints hints = GetControllerButtonHints(hand); if (hints != null) { hints.HideText(button); } }
//------------------------------------------------- public static void HideAllTextHints(Hand hand) { ControllerButtonHints hints = GetControllerButtonHints(hand); if (hints != null) { hints.HideAllText(); } }
//------------------------------------------------- public static void HideButtonHint(Hand hand, params EVRButtonId[] buttons) { ControllerButtonHints hints = GetControllerButtonHints(hand); if (hints != null) { hints.HideButtonHint(buttons); } }
//------------------------------------------------- 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); } }
//------------------------------------------------- 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); } }
//------------------------------------------------- public static void HideTextHint(Hand hand, ISteamVR_Action_In_Source action) { ControllerButtonHints hints = GetControllerButtonHints(hand); if (hints != null) { hints.HideText(action); } }
//------------------------------------------------- private void OnHandHoverEnd(Hand hand) { if (!justPickedUpItem && requireTriggerPressToTake && showTriggerHint) { ControllerButtonHints.HideTextHint(hand, Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger); } justPickedUpItem = false; }
//------------------------------------------------- public static void HideButtonHint(Hand hand, params ISteamVR_Action_In_Source[] actions) { ControllerButtonHints hints = GetControllerButtonHints(hand); if (hints != null) { hints.HideButtonHint(actions); } }
//------------------------------------------------- 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); } }
// 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(); } }
//------------------------------------------------- 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); } }
//------------------------------------------------- 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); } }
//------------------------------------------------- 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); } }
public static string GetActiveHintText(Hand hand, EVRButtonId button) { ControllerButtonHints controllerButtonHints = ControllerButtonHints.GetControllerButtonHints(hand); if (controllerButtonHints != null) { return(controllerButtonHints.GetActiveHintText(button)); } return(string.Empty); }
//------------------------------------------------- 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); } }
//------------------------------------------------- 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); } }
//------------------------------------------------- public static bool IsButtonHintActive(Hand hand, ISteamVR_Action_In_Source action) { ControllerButtonHints hints = GetControllerButtonHints(hand); if (hints != null) { return(hints.IsButtonHintActive(action)); } return(false); }
//------------------------------------------------- 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); }
//------------------------------------------------- public static bool IsButtonHintActive(Hand hand, EVRButtonId button) { ControllerButtonHints hints = GetControllerButtonHints(hand); if (hints != null) { return(hints.IsButtonHintActive(button)); } return(false); }
//------------------------------------------------- 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(); } }
private void HandHoverUpdate(Hand hand) { if (hand.GetStandardInteractionButtonDown()) { InputModule.instance.Submit(base.gameObject); ControllerButtonHints.HideButtonHint(hand, new EVRButtonId[] { EVRButtonId.k_EButton_Axis1 }); } }
public void CancelTeleportHint() { if (hintCoroutine != null) { ControllerButtonHints.HideTextHint(player.leftHand, teleportAction); ControllerButtonHints.HideTextHint(player.rightHand, teleportAction); StopCoroutine(hintCoroutine); hintCoroutine = null; } CancelInvoke("ShowTeleportHint"); }
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"); }
private static ControllerButtonHints GetControllerButtonHints(Hand hand) { if (hand != null) { ControllerButtonHints componentInChildren = hand.GetComponentInChildren <ControllerButtonHints>(); if (componentInChildren != null && componentInChildren.initialized) { return(componentInChildren); } } return(null); }
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; } }
//------------------------------------------------- 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; }
//------------------------------------------------- // 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); }
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; }