private void EvaluateButton() { switch (inputState) { case InputState.Pressed: if (InputManager.GetButtonDown(buttonName, playerID)) { onAction.Invoke(); } break; case InputState.Released: if (InputManager.GetButtonUp(buttonName, playerID)) { onAction.Invoke(); } break; case InputState.Held: if (InputManager.GetButton(buttonName, playerID)) { onAction.Invoke(); } break; } }
public float GetMoveAcceleration() { if (InputMng.GetButton("Right Trigger", playerId) || InputMng.GetAxis("Right Trigger", playerId) > 0.5f) { return(1f); } return(0f); }
// Update is called once per frame void Update() { // Eu: The input is inverted because I'm stupid float h = -Input.GetAxisRaw("Horizontal", GetPlayerID()); float v = -Input.GetAxisRaw("Vertical", GetPlayerID()); Vector2 walkDir = new Vector2(h, v); if (walkDir.SqrMagnitude() > 0.1f * 0.1f) { this.walkDirection = walkDir; } else { this.walkDirection = new Vector2(0, 0); } this.jump = Input.GetButton("Jump", GetPlayerID()); //this.run = Input.GetButton("Run", GetPlayerID()); if (this.attack == false && Input.GetButton("Attack", GetPlayerID()) == true) { timeAttackDown = Time.time; this.attackDown = true; this.attackUp = false; } else if (this.attack == true && Input.GetButton("Attack", GetPlayerID()) == false) { this.attackUp = true; this.attackDown = false; } else { this.attackUp = false; this.attackDown = false; } this.attack = Input.GetButton("Attack", GetPlayerID()); }
public static bool GetButton(string buttonName) { return(InputManager.GetButton(buttonName)); }
public bool GetDashTrigger() { bool flag = InputMng.GetButton("Left Bumper", playerId); return(flag); }