示例#1
0
    public override void stateAttackEnd()
    {
        if (selPro == null)
        {
            roleProperty selPro = this.transform.GetComponent <roleProperty>();
        }

        if (enemyObj != null)
        {
            roleProperty enemyPro = enemyObj.transform.GetComponent <roleProperty>();
            int          Hp       = RoleDamageCal.instance.DamageCal(selPro, enemyPro);

            enemyPro.SubHpValue(Hp); //UI扣血显示
            if (enemyPro.hp <= 0)    //敌人死亡
            {
                baseAI enemyAI = enemyObj.transform.GetComponent <baseAI>();
                enemyAI.stateDieStart();
                //this.enemyObj = null;

                getNowNewEnemyFromLst();  //死亡,挑选新的敌人
            }

            if (enemyObj != null)
            {
                lookAtEnemy(this.gameObject, enemyObj);
            }
        }
        stateStandEnd();
    }
示例#2
0
    //攻击->攻击(触发制,动作完成判断):双方相互攻击
    //攻击->待机(触发制,动作完成判断)
    public override void stateAttackEnd()
    {
        if (selPro == null)
        {
            roleProperty selPro = this.transform.GetComponent <roleProperty>();
        }

        if (enemyObj != null)
        {
            roleProperty enemyPro = enemyObj.transform.GetComponent <roleProperty>();
            int          Hp       = RoleDamageCal.instance.DamageCal(selPro, enemyPro);

            enemyPro.SubHpValue(Hp); //UI扣血显示
            if (enemyPro.hp <= 0)    //死亡
            {
                baseAI enemyAI = enemyObj.transform.GetComponent <baseAI>();
                enemyAI.stateDieStart(); //处理 对方死亡动画及结算
                this.enemyObj = null;
            }

            // getNowNewEnemyFromLst();
            if (enemyObj != null)
            {
                lookAtEnemy(this.gameObject, enemyObj);
            }
        }

        startSkillCD();

        /*
         * IbaseANI tmpAni = this.transform.GetComponent<monsterAniControl>();
         *
         * bool isAttack = tmpAni.attackStateEnd(); //伤害计算及UI显示,以及是否死亡的结算
         *
         * if (isAttack)
         * {
         *  tmpAni.PlayState(roleState.attack);
         * }
         * else
         * {
         *  tmpAni.PlayState(roleState.stand);
         * }*/
    }