// Update is called once per frame
    void FixedUpdate()
    {
        //text.text = "";

        //gameObject.transform.position = new Vector3(gameObject.transform.position.x + speed, 0, 0);
        //Debug.Log(gameObject.name + "update1");

        if (NowHP <= 0 && canControll && transform.position.y == 0)
        {
            finalMove = Vector3.zero;
            playerCommand.HistoryClear();
            animator.SetBool("Down", true);
            playSEScript.PlayVoice((int)PlaySEScript.VoiceData.LOSE);
            canControll = false;
        }

        if (enemyScript.NowHP <= 0 && NowHP > enemyScript.NowHP && canControll && transform.position.y == 0)
        {
            finalMove = Vector3.zero;
            playerCommand.HistoryClear();
            animator.SetBool("Win", true);
            playSEScript.PlayVoice((int)PlaySEScript.VoiceData.WIN);
            canControll = false;
        }

        //if (animator.GetInteger("Damage") == 0 && transform.position.y > 0) state = "Jump";

        if (canControll)
        {
            SetDirection();
        }

        string name = playerCommand.controllerName;

        //コントローラーがAIじゃないなら入力を検知する
        if (name != "AI")
        {
            if (canControll)
            {
                playerCommand.InputKey();
            }
        }

        if (state != "GuardCrash")
        {
            guardCrashCount = 0;
        }


        switch (state)
        {
        case "Stand":
            //SetDirection();
            Stand();
            break;

        case "Dash":
            Dashing();
            break;

        case "Sit":
            //SetDirection();
            Sit();
            break;

        case "Jump":
            Jump();
            Jumping();
            break;

        case "Guard":
            Guard();
            break;

        case "StandGuard":
            StandGuard();
            break;

        case "SitGuard":
            SitGuard();
            break;

        case "Punch":
            Punch();
            break;

        case "Kick":
            Kick();
            break;

        case "SitPunch":
            SitPunch();
            break;

        case "SitKick":
            SitKick();
            break;

        case "Special":
            Special();
            break;

        case "Damage":
            Damage();
            break;

        case "JumpingDamage":
            JumpingDamage();
            break;

        case "BlowOff":
            BlowOff();
            break;

        case "GuardCrash":
            GuardCrash();
            break;
        }

        FinallyMove();
        CheckGuard();

        //if (playerCommand.ControllerName == "AI") Debug.Log(gameObject.name + "STATE:" + state);
    }