Example #1
0
    void OnEventStartAttack(int attackType)
    {
        // Debug.LogFormat("OnEventStartAttack attackType:{0}", attackType);
        attackSeqCount += 1;
        attackSeqState  = AttackSeqState.Attack; // 进入攻击状态,可以触发连击

        if (mkb == null)
        {
            return;
        }
        mkb.OnEventStartAttack(attackType);
    }
Example #2
0
    void OnEventEndAttack(int attackType)
    {
        // Debug.LogFormat("OnEventEndAttack attackType:{0}", attackType);
        attackSeqCount -= 1;
        if (attackSeqCount <= 0)
        {
            attackSeqState = AttackSeqState.Idle;  // 退出攻击状态,无法触发连击
        }
        else
        {
            attackSeqState = AttackSeqState.Attack;  // 进入攻击状态,可以触发连击
        }
        // animator.SetTrigger("attackToIdle");

        if (mkb == null)
        {
            return;
        }
        mkb.OnEventEndAttack(attackType);
    }