예제 #1
0
    void Dodge()
    {
        DebugDodgeTime++;

        /*if (!Dodgable) return;
         * if (IsDodging)
         * {
         *  IsDodging = false;
         *  return;
         * }*/

        float angle = Mathf.Atan2(move.x, move.z) * Mathf.Rad2Deg;

        if (Input.GetButtonDown("JoyStickX") && DebugDodgeTime >= 40)
        {
            if (!playerHP.CheckSP(2f))
            {
                if (!playerHP.OverpullSP())
                {
                    return;
                }
            }
            transform.Rotate(0, angle, 0);
            DebugDodgeTime = 0;
            // IsDodging = Input.GetButtonDown("JoyStickX");
            m_Animator.ResetTrigger("At");
            m_Animator.SetTrigger("Dodge");
        }
    }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        animatorState = animator.GetCurrentAnimatorStateInfo(0);
        DodgeInterrupt();

        if (Input.GetButtonDown("R1"))
        {
            if (!playerHP.CheckSP(1f))
            {
                return;
            }
            StopCoroutine(AttackReseter);
            animator.SetTrigger("At");
            animator.ResetTrigger("HeavyAt");
            AttackReseter = StartCoroutine(AttackReset());
            if (SwitchState)
            {
                SwitchState = false;
                if (AttackCombo < AttackTrueNormalized.Length)
                {
                    AttackCombo++;
                    animator.SetInteger("Attack", AttackCombo);
                }
            }
        }
        if (Input.GetButtonDown("R2"))
        {
            StopCoroutine(AttackReseter);
            animator.SetTrigger("HeavyAt");
            animator.ResetTrigger("At");
            animator.SetBool("HeavyAttackCharging", true);
            AttackReseter = StartCoroutine(AttackReset());
            if (SwitchState)
            {
                SwitchState = false;
                if (AttackCombo < AttackTrueNormalized.Length)
                {
                    AttackCombo++;
                    animator.SetInteger("Attack", AttackCombo);
                }
            }
        }
        if (Input.GetButton("R2"))
        {
            animator.SetBool("HeavyAttackCharging", true);
        }
        else
        {
            animator.SetBool("HeavyAttackCharging", false);
        }
        CheckAnimatorState();
    }