public class PlayerCtrl : PlayerValueManager
{
    Rigidbody2D rigidbody;
    Animator animator;
    float MoveX;
    float currentAttackDelay;
    float MoveY;
    int AttackCount = 1;

    bool isAttack = false;
    // Start is called before the first frame update
    void Start()
    {
       
        rigidbody = GetComponent<Rigidbody2D>();
        animator = GetComponent<Animator>();
        
    }
    // Update is called once per frame
    void Update()
    {
        MoveCheck();
        AnimCheck();
        AttackInputCheck();
        AttackDelayDecrease();
        
        /* if(animator.GetCurrentAnimatorStateInfo(0).IsTag("AttackMotion"))
        {
            Debug.Log(animator.GetInteger("AttackCount") );
        } */
        Debug.Log(AttackCount);
    }
    void MoveCheck()
    {
         MoveX = Input.GetAxisRaw("Horizontal");
         MoveY = Input.GetAxisRaw("Vertical");

        rigidbody.velocity = new Vector2 (MoveX  ,MoveY ) *MoveSpeed * Time.deltaTime;
    }
    void AnimCheck()
    {
        if(MoveX == 0 && MoveY == 0)
        {
            animator.SetBool("isRunning" , false);
        }
        else
        {
            animator.SetBool("isRunning"true);
        }

        if(MoveX < 0)
        {
            transform.localScale = new Vector2(-3,3);
        }
        else if(MoveX > 0)
        {
            transform.localScale = new Vector2(3,3);
        }
        
        
            if(AttackCount < 4)
            {
                animator.SetInteger("AttackCount" , AttackCount);
            }
        

        if(EndCheckAnimation("AttackMotion"))
            animator.SetBool("isAttack" , false);

       // AttackCount = animator.GetInteger("AttackCount");       
    }
    
    void AttackInputCheck()
    {
        if(Input.GetKeyDown(KeyCode.X) && currentAttackDelay < attackDelay && !isAttack )
        {
            if(AttackCount >= 4 )
            {
                AttackCount = 1;
            }
            StartCoroutine(Attack());
        }
    }
    bool EndCheckAnimation(string animationName)
    {
        return 
        animator.GetCurrentAnimatorStateInfo(0).IsTag(animationName) &&
        animator.GetCurrentAnimatorStateInfo(0).normalizedTime >= 0.99f;
    }
    void AttackDelayDecrease()
    {
        currentAttackDelay -= Time.deltaTime;
    }
    IEnumerator Attack()
    {
        isAttack = true;
        animator.SetBool("isAttack"true);      
          
        yield return new WaitForSeconds(attackDelay);
               
        currentAttackDelay = attackDelay;
        AttackCount++;              
        isAttack = false;
    }
    
    
}



viewimage.php?id=2abcdd23dad63db0&no=24b0d769e1d32ca73ced84fa11d0283162f18dd5505eb28abfc2607ab56f7bd87e85c777e7ac15941b4590e1f9353754be2fe8cbb9782b1d5288b31e2f911e80f03812


공격키 누를때마다 isAttack을 true로 바꾸고 재생을 99퍼까지하면 다시 false로바꿈(한번만 실행하기 위해서)


내가 원하는건 연속으로 4번누르면 공격모션 4개가 순차적으로 나가는거고  텀을두고 한번씩만 누르면 계속 첫번째 모션만 나오는거임

근데 어찌해야할지 감이 안잡힌다 첨부터 코드를 잘못짠거같음..