コード例 #1
0
    void UI_anim()
    {
        float walk = navAgent.velocity.magnitude;
        float run  = 0;

        if (walk >= UI_Horse.runSpeed)
        {
            run = walk;
        }
        UI_Horse.Animating(walk, 0, run);
    }
コード例 #2
0
    void FixedUpdate()
    {
        float inputWalk = CrossPlatformInputManager.GetAxisRaw("Vertical");

        if (inputWalk > 0)
        {
            inputWalk = 1;
        }
        if (inputWalk < 0)
        {
            inputWalk = -1;
        }
        float inputTurn = CrossPlatformInputManager.GetAxisRaw("Horizontal");
        float inputRun  = CrossPlatformInputManager.GetAxisRaw("Run");

        Player_Horse.Move(inputWalk * Player_Horse.walkSpeed, inputRun * Player_Horse.runSpeed);
        Player_Horse.Turn(inputTurn * Player_Horse.turnSpeed, inputWalk);
        Player_Horse.Animating(inputWalk, inputTurn, inputRun);
    }