void Update ()
{
    
		

    if (flyingController.IsFlying())
    {
        FlyingAnimations();
    }
    
    else  if (characterController.IsFalling())
    {
        animationGameObject.animation.CrossFade("fall");
    }
     
    //must be grounded
    else  
        {
            GroundedAnimations();        
       
        }
		

    
}
Пример #2
0
    void Update() {

        if (characterController.IsJumping() && !isFlying || characterController.IsFalling() )
        {

            //next jump button shouldn't be too close to first jump time
            if ((characterController.LastJumpTime() + jumpOffset) > Time.time )
                return;


            if (Input.GetButtonDown("Jump"))
              ActivateFlying();               
            
        }


        if (isFlying)
            FlyingUpdate();

    }