Exemple #1
0
 /// <summary>
 /// Get whether or not a button has been pressed from the active control scheme
 /// </summary>
 /// <param name="hand">Which hand is the button on</param>
 /// <param name="button">Which button is being pressed</param>
 /// <returns>A bool indicating whether the given button has been pressed</returns>
 public bool GetButton(InputControl.Hand hand, InputControl.Button button) 
 {
     InputControl control = (currControl == OVRPlugin.Controller.Hands) ? hands : controllers;
     if (control == null)
     {
         return false;
     }
     return control.GetButton(hand , button);
 }
Exemple #2
0
        /// <summary>
        /// Get a float value representing how much a button has been pressed from the active control scheme
        /// </summary>
        /// <param name="hand">Which hand is the axis on</param>
        /// <param name="button">Which button is being pressed</param>
        /// <returns>A float from 0-1 indicating how much the input has been pressed</returns>
        public float GetAxis(InputControl.Hand hand , InputControl.Button button) 
        {
            InputControl control = (currControl == OVRPlugin.Controller.Hands) ? hands : controllers;
            if (control == null)
            {
                return 0;
            }

            return control.GetAxis(hand, button);
        }
        /// <summary>
        /// Get whether or not a button has been pressed from the active control scheme
        /// </summary>
        /// <param name="hand">Which hand is the button on</param>
        /// <param name="button">Which button is being pressed</param>
        /// <returns>A bool indicating whether the given button has been pressed</returns>
        public bool GetButton(InputControl.Hand hand, InputControl.Button button)
        {
            InputControl control = (currControl == OVRPlugin.Controller.Hands) ? hands : controllers;

            return(control.GetButton(hand, button));
        }