Esempio n. 1
0
        /// <summary>
        /// Returns element pressed down state..
        /// </summary>
        /// <param name="chirality">Controller chirality</param>
        /// <param name="element">Controller element</param>
        /// <returns>Was the controller element pressed down</returns>
        public static bool GetPressDown(FinchChirality chirality, FinchControllerElement element)
        {
            bool leftDown  = FinchInput.GetPressDown(FinchNodeType.LeftHand, element);
            bool rightDown = FinchInput.GetPressDown(FinchNodeType.RightHand, element);

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

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

            case FinchChirality.Left:
                return(leftDown);

            case FinchChirality.Any:
                return(leftDown || rightDown);

            case FinchChirality.Both:
                return(leftDown && rightPress || rightDown && leftPress);

            default:
                return(false);
            }
        }
        private void TryBindChiralityManually()
        {
            bool pressLeft  = FinchInput.GetPressDown(FinchNodeType.LeftUpperArm, FinchControllerElement.HomeButton);
            bool pressRight = FinchInput.GetPressDown(FinchNodeType.RightUpperArm, FinchControllerElement.HomeButton);

            if (pressLeft || pressRight)
            {
                if (pressLeft)
                {
                    FinchCore.SwapNodes(FinchNodeType.LeftUpperArm, FinchNodeType.RightUpperArm);
                }

                if (!tremblePass)
                {
                    ResetValue();
                    tremblePass = true;
                }
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Returns element pressed down state.
 /// </summary>
 /// <param name="element">Controller element</param>
 /// <returns>Was the controller element pressed down</returns>
 public bool GetPressDown(FinchControllerElement element)
 {
     return(FinchInput.GetPressDown(Node, element));
 }