Ejemplo n.º 1
0
    public static string GetFullAxisName(string baseAxisName, InputType inputType, InputSide inputSide = InputSide.Full)
    {
        switch (inputType)
        {
        case InputType.Keyboard:
            baseAxisName = "KB" + baseAxisName;
            break;

        case InputType.Controller:
            baseAxisName = "CR" + baseAxisName;
            break;

        default:
            break;
        }
        switch (inputSide)
        {
        case InputSide.Left:
            baseAxisName += "L";
            break;

        case InputSide.Right:
            baseAxisName += "R";
            break;

        default:
            break;
        }
        return(baseAxisName);
    }
Ejemplo n.º 2
0
        public bool IsSidePressed(InputSide side)
        {
            var guiSide      = side == InputSide.Left ? leftSide : rightSide;
            var keyboardSide = side == InputSide.Left ? KeyCode.LeftArrow :
                               KeyCode.RightArrow;

            return(Input.GetKey(keyboardSide) || guiSide.isPressed);
        }
Ejemplo n.º 3
0
 internal OperatorProperties(
     TokenType type,
     int precedence,
     InputSide inputSide = InputSide.Both,
     bool allowOverload  = false
     )
 {
     Type          = type;
     Precedence    = precedence;
     InputSide     = inputSide;
     AllowOverload = allowOverload;
 }
Ejemplo n.º 4
0
 public float getTrigger(InputSide leftOrRight)
 {
     //Return the x and y values of the left or right trigger
     if (leftOrRight == InputSide.LEFT)
     {
         return(visibleState.leftTrigger);
     }
     else
     {
         return(visibleState.rightTrigger);
     }
 }
Ejemplo n.º 5
0
 public Vector2 getStick(InputSide leftOrRight)
 {
     //Return the x and y values of the left or right stick
     if (leftOrRight == InputSide.LEFT)
     {
         return(visibleState.leftStick);
     }
     else
     {
         return(visibleState.rightStick);
     }
 }
Ejemplo n.º 6
0
Archivo: Bot.cs Proyecto: ip/pinball
        private void _TriggerFlippersIfNeeded()
        {
            bool[]  isSidePressed = _input.isSidePressed;
            Vector2 ballPos       = _ball.transform.position;

            for (int j = 0; j < isSidePressed.Length; ++j)
            {
                isSidePressed[j] = false;
            }

            for (int i = 0; i < _flipperTriggers.Length; ++i)
            {
                FlipperTrigger trigger       = _flipperTriggers[i];
                bool           shouldTrigger = trigger.isTriggered;

                if (shouldTrigger)
                {
                    InputSide side = trigger.flipper.inputSide;
                    isSidePressed[(int)side] = true;
                }
            }
        }
Ejemplo n.º 7
0
Archivo: Bot.cs Proyecto: ip/pinball
 public bool IsSidePressed(InputSide side) => isSidePressed[(int)side];
Ejemplo n.º 8
0
 public bool IsSidePressed(InputSide side) => false;