Exemple #1
0
        /// <summary>
        /// Returns element pressed up state.
        /// </summary>
        /// <param name="chirality">Controller chirality</param>
        /// <param name="element">Controller element</param>
        /// <returns>Was the controller element pressed up</returns>
        public static bool GetPressUp(FinchChirality chirality, FinchControllerElement element)
        {
            bool leftUp  = FinchInput.GetPressUp(FinchNodeType.LeftHand, element);
            bool rightUp = FinchInput.GetPressUp(FinchNodeType.RightHand, element);

            bool leftPress  = FinchInput.GetPress(FinchNodeType.LeftHand, element);
            bool rightPress = FinchInput.GetPress(FinchNodeType.RightHand, element);

            switch (chirality)
            {
            case FinchChirality.Right:
                return(rightUp);

            case FinchChirality.Left:
                return(leftUp);

            case FinchChirality.Any:
                return(leftUp || rightUp);

            case FinchChirality.Both:
                return(leftUp && !rightPress || rightUp && !leftPress);

            default:
                return(false);
            }
        }
Exemple #2
0
 /// <summary>
 /// Returns element pressing state.
 /// </summary>
 /// <param name="element">Controller element</param>
 /// <returns>Is the controller element pressed</returns>
 public bool GetPress(FinchControllerElement element)
 {
     return(FinchInput.GetPress(Node, element));
 }