Пример #1
0
    void Flying()
    {
        UpdateHookFire();

        if (jumpControl.isGrounded())
        {
            ChangeState(HookshotState.READY);
        }
    }
Пример #2
0
 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);
     }
 }
Пример #3
0
    // 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;
        }
    }
Пример #4
0
 public bool isGrounded()
 {
     return(jump.isGrounded());
 }