Esempio n. 1
0
        //-------------------------------------------------
        public static void HideButtonHint(BNG.Grabber hand, params ISteamVR_Action_In_Source[] actions)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                hints.HideButtonHint(actions);
            }
        }
Esempio n. 2
0
        //-------------------------------------------------
        public static void HideAllTextHints(BNG.Grabber hand)
        {
            ControllerButtonHints hints = GetControllerButtonHints(hand);

            if (hints != null)
            {
                hints.HideAllText();
            }
        }
Esempio n. 3
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);
            }
        }
Esempio n. 4
0
        //-------------------------------------------------
        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);
        }
Esempio n. 5
0
        //-------------------------------------------------
        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);
        }
Esempio n. 6
0
        //-------------------------------------------------
        // 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);
        }
Esempio n. 7
0
        //-------------------------------------------------
        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();
                //}
            }
        }
Esempio n. 8
0
        //-------------------------------------------------
        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);
                //}
            }
        }