void Flying() { UpdateHookFire(); if (jumpControl.isGrounded()) { ChangeState(HookshotState.READY); } }
void Hopping() { if (jump.isGrounded()) { ChangeState(FrogState.LANDED); } else if (Mathf.Abs(player.velocity.x) <= maxSpeed) { Vector2 force = new Vector2(airForce, 0) * Input.GetAxisRaw("Horizontal"); player.AddForce(force); } }
// Update is called once per frame void Update() { falling = !jump.isGrounded(); lethalFall = falling && player.velocity.y < -10f; if (didLethalFall) { time += Time.deltaTime; } if (time > 1) { didLethalFall = false; time = 0; } }
public bool isGrounded() { return(jump.isGrounded()); }