예제 #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());
 }