void Update()
    {
        ThirdPersonController marioController = GetComponent<ThirdPersonController> ();
        float currentSpeed = marioController.GetSpeed ();
         networkSyncAnimation = GetComponent<NetworkSyncAnimation> ();

        // Fade in run
        if (currentSpeed > marioController.walkSpeed) {
            animation.CrossFade ("run");
            // We fade out jumpland quick otherwise we get sliding feet
            animation.Blend ("jumpland", 0);
            networkSyncAnimation.SendMessage ("SyncAnimation", "run");
            // Fade in walk
        } else if (currentSpeed > 0.1f) {
            animation.CrossFade ("walk");
            // We fade out jumpland realy quick otherwise we get sliding feet
            animation.Blend ("jumpland", 0);
            networkSyncAnimation.SendMessage ("SyncAnimation", "walk");
            // Fade out walk and run
        } else {
            animation.CrossFade ("idle");
            networkSyncAnimation.SendMessage ("SyncAnimation", "idle");
        }

        animation["run"].normalizedSpeed = runSpeedScale;
        animation["walk"].normalizedSpeed = walkSpeedScale;

        if (marioController.IsJumping ()) {
            if (marioController.IsCapeFlying ()) {
                animation.CrossFade ("jetpackjump", 0.2f);
                networkSyncAnimation.SendMessage ("SyncAnimation", "jetpackjump");
            } else if (marioController.HasJumpReachedApex ()) {
                animation.CrossFade ("jumpfall", 0.2f);
                networkSyncAnimation.SendMessage ("SyncAnimation", "jumpfall");
            } else {
                animation.CrossFade ("jump", 0.2f);
                networkSyncAnimation.SendMessage ("SyncAnimation", "jump");
            }
            // We fell down somewhere
        } else if (!marioController.IsGroundedWithTimeout ()) {
            animation.CrossFade ("ledgefall", 0.2f);
            networkSyncAnimation.SendMessage ("SyncAnimation", "ledgefall");
            // We are not falling down anymore
        } else {
            animation.Blend ("ledgefall", 0.0f, 0.2f);
        }
    }
 public void DidLand()
 {
     animation.Play("jumpland");
     networkSyncAnimation.SendMessage("SyncAnimation", "jumpland");
 }
    void Update()
    {
        ThirdPersonController marioController = GetComponent <ThirdPersonController> ();
        float currentSpeed = marioController.GetSpeed();

        networkSyncAnimation = GetComponent <NetworkSyncAnimation> ();

        // Fade in run
        if (currentSpeed > marioController.walkSpeed)
        {
            animation.CrossFade("run");
            // We fade out jumpland quick otherwise we get sliding feet
            animation.Blend("jumpland", 0);
            networkSyncAnimation.SendMessage("SyncAnimation", "run");
            // Fade in walk
        }
        else if (currentSpeed > 0.1f)
        {
            animation.CrossFade("walk");
            // We fade out jumpland realy quick otherwise we get sliding feet
            animation.Blend("jumpland", 0);
            networkSyncAnimation.SendMessage("SyncAnimation", "walk");
            // Fade out walk and run
        }
        else
        {
            animation.CrossFade("idle");
            networkSyncAnimation.SendMessage("SyncAnimation", "idle");
        }

        animation["run"].normalizedSpeed  = runSpeedScale;
        animation["walk"].normalizedSpeed = walkSpeedScale;

        if (marioController.IsJumping())
        {
            if (marioController.IsCapeFlying())
            {
                animation.CrossFade("jetpackjump", 0.2f);
                networkSyncAnimation.SendMessage("SyncAnimation", "jetpackjump");
            }
            else if (marioController.HasJumpReachedApex())
            {
                animation.CrossFade("jumpfall", 0.2f);
                networkSyncAnimation.SendMessage("SyncAnimation", "jumpfall");
            }
            else
            {
                animation.CrossFade("jump", 0.2f);
                networkSyncAnimation.SendMessage("SyncAnimation", "jump");
            }
            // We fell down somewhere
        }
        else if (!marioController.IsGroundedWithTimeout())
        {
            animation.CrossFade("ledgefall", 0.2f);
            networkSyncAnimation.SendMessage("SyncAnimation", "ledgefall");
            // We are not falling down anymore
        }
        else
        {
            animation.Blend("ledgefall", 0.0f, 0.2f);
        }
    }