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); }
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); }
internal OperatorProperties( TokenType type, int precedence, InputSide inputSide = InputSide.Both, bool allowOverload = false ) { Type = type; Precedence = precedence; InputSide = inputSide; AllowOverload = allowOverload; }
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); } }
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); } }
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; } } }
public bool IsSidePressed(InputSide side) => isSidePressed[(int)side];
public bool IsSidePressed(InputSide side) => false;