//------------------------------------------------- public static void HideButtonHint(BNG.Grabber hand, params ISteamVR_Action_In_Source[] actions) { ControllerButtonHints hints = GetControllerButtonHints(hand); if (hints != null) { hints.HideButtonHint(actions); } }
//------------------------------------------------- public static void HideAllTextHints(BNG.Grabber hand) { ControllerButtonHints hints = GetControllerButtonHints(hand); if (hints != null) { hints.HideAllText(); } }
//------------------------------------------------- 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(BNG.Grabber hand, ISteamVR_Action_In_Source action) { ControllerButtonHints hints = GetControllerButtonHints(hand); if (hints != null) { return(hints.GetActiveHintText(action)); } return(string.Empty); }
//------------------------------------------------- public static bool IsButtonHintActive(BNG.Grabber hand, ISteamVR_Action_In_Source action) { ControllerButtonHints hints = GetControllerButtonHints(hand); if (hints != null) { return(hints.IsButtonHintActive(action)); } return(false); }
//------------------------------------------------- // These are the static functions which are used to show/hide the hints //------------------------------------------------- //------------------------------------------------- private static ControllerButtonHints GetControllerButtonHints(BNG.Grabber hand) { if (hand != null) { ControllerButtonHints hints = hand.GetComponentInChildren <ControllerButtonHints>(); if (hints != null && hints.initialized) { return(hints); } } return(null); }
//------------------------------------------------- public static void HideTextHint(BNG.Grabber hand, ISteamVR_Action_In_Source action) { ControllerButtonHints hints = GetControllerButtonHints(hand); if (hints != null) { hints.HideText(action); //if (hand != null) //{ // if (hints.autoSetWithControllerRangeOfMotion) // hand.ResetTemporarySkeletonRangeOfMotion(); //} } }
//------------------------------------------------- public static void ShowTextHint(BNG.Grabber hand, ISteamVR_Action_In_Source action, string text, bool highlightButton = true) { ControllerButtonHints hints = GetControllerButtonHints(hand); if (hints != null) { hints.ShowText(action, text, highlightButton); //if (hand != null) //{ // if (hints.autoSetWithControllerRangeOfMotion) // hand.SetTemporarySkeletonRangeOfMotion(SkeletalMotionRangeChange.WithController); //} } }