Esempio n. 1
0
    //死亡
    public void Die(SMsgActionDie_SC sMsgActionDie_SC)
    {
        this.m_isDie = true;

        //是否施放死亡子弹
        if (m_MonsterConfigData._DeathBullet.Length > 0)
        {
            for (int i = 0; i < m_MonsterConfigData._DeathBullet.Length; i++)
            {
                int bulletID = m_MonsterConfigData._DeathBullet[i];
                BulletFactory.Instance.CreateBullet(bulletID, RoleDataModel.SMsg_Header.uidEntity, ThisTransform, 0, 0);
                //BulletFactory.Instance.bullet
                //BulletData bulletData = SkillDataManager.Instance.GetBulletData(bulletID);
            }
        }

        //怪物死亡特效
        bool isDeadEffect = m_MonsterConfigData._deadEffect != "0";

        if (isDeadEffect)
        {
            GameObject deadEffectPrefab = MapResManager.Instance.GetMapEffectPrefab(m_MonsterConfigData._deadEffect);
            if (deadEffectPrefab != null)
            {
                GameObject deadEffect = (GameObject)Instantiate(deadEffectPrefab);
                deadEffect.transform.position = ThisTransform.position;
                deadEffect.AddComponent <DestroySelf>();
            }
            //normal
            this.NormalStatus.SetActive(false);
            m_FSMSystem.FindState(StateID.MonsterDie).m_roleAnimationComponent = this.NormalStatus.animation;
            SplitToDie = false;
        }
        else
        {
            if (this.SplitStatus != null)
            {
                switch (sMsgActionDie_SC.byDieType)
                {
                case 0:                   //Normal
                    this.NormalStatus.SetActive(true);
                    this.SplitStatus.SetActive(false);
                    m_FSMSystem.FindState(StateID.MonsterDie).m_roleAnimationComponent = this.NormalStatus.animation;
                    SplitToDie = false;
                    break;

                case 1:                   //Split
                    this.NormalStatus.SetActive(false);
                    this.SplitStatus.SetActive(true);
                    m_FSMSystem.FindState(StateID.MonsterDie).m_roleAnimationComponent = this.SplitStatus.animation;
                    this.ShowHurtFlash(false, this.m_hurtDuration);
                    SplitToDie = true;
                    ShowBloodEffect();
                    break;
                }
            }
        }


        if (sMsgActionDie_SC.byDieType == 1)
        {
            if (sMsgActionDie_SC.byTrigger == 1)
            {
                ShowSplitEffect(sMsgActionDie_SC);
            }
        }


        m_FSMSystem.PerformTransition(Transition.MonsterToDie);

        //if (this.m_MonsterConfigData.MonsterSubType == 2)
        //{
        //    PopupObjManager.Instance.ShowBattleResult(true);
        //}
    }
Esempio n. 2
0
 public NextStateInfo(AbstractNPCBrain abstractNpc, STATE stateTrue, STATE stateFalse, Order order)
 {
     this.stateCaseTrue  = FSMSystem.FindState(abstractNpc, stateTrue);
     this.stateCaseFalse = FSMSystem.FindState(abstractNpc, stateFalse);
     this.order          = order;
 }