private void OnEnemyOnDie(GameEvent ge)
        {
            CurrentMonsterDieCount++;
            for (int i = 0; i < CurrentAllMonsterdataList.Count; ++i)
            {
                if (CurrentAllMonsterdataList[i].MonsterPointdataList.Count <= 0)
                {
                    continue;
                }
                if (CurrentAllMonsterdataList[i].MonsterPointdataList[0].Entertype == MonsterEnterType.Bench && CurrentAllMonsterdataList[i].MonsterPointdataList[0].BenchCount == CurrentMonsterDieCount)
                {
                    int                 fightCount = ObjectSelf.GetInstance().IsLimitFight ? ObjectSelf.GetInstance().LimitFightMgr.m_RoundNum : CurrentFightCount;
                    int                 id         = SceneObjectManager.GetInstance().GetMosnterBundleRes(fightCount, i);
                    MonsterTemplate     pRow       = (MonsterTemplate)DataTemplate.GetInstance().m_MonsterTable.getTableData(id);
                    ArtresourceTemplate art        = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(pRow.getArtresources());
                    string              _res       = art.getArtresources();
                    GameObject          _Monster   = AssetLoader.Inst.GetAssetRes(_res);
                    GameObject          obj        = Instantiate(_Monster, CurrentAllMonsterdataList[i].MyPos, CurrentAllMonsterdataList[i].MyAngle) as GameObject;
                    float               _zoom      = art.getArtresources_zoom() * pRow.getMonsterEnlarge();
                    obj.transform.localScale = new UnityEngine.Vector3(_zoom, _zoom, _zoom);
                    MonsterObjList.Add(obj);
                    SetMonsterBirthState(obj, CurrentAllMonsterdataList[i], false, i);
                }
            }

            //X_GUID monsterGuid = ge.data as X_GUID;
            //if (monsterGuid != null)
            //{
            //    //判断前排英雄是否消失;
            //    //TODO::这里应该考虑到是否有支援怪物(和策划确认了不要支援怪物了2015/10/30/11.20);
            //    //List<ObjectMonster> monsters = SceneObjectManager.GetInstance().GetSceneMonsterList();
            //    //if (monsters != null && monsters.Count > 0)
            //    //{
            //    //    //写死的阵型,前2后3;
            //    //    for (int i = 0; i < 2; i++)
            //    //    {

            //    //    }
            //    //}

            //    if (IsFrontRowDie())
            //    {
            //        SceneObjectManager.GetInstance().ObjectHeroMoveTarget();
            //    }
            //}
        }
Exemplo n.º 2
0
        //实例化怪物 [1/20/2015 Zmy]
        private void InstantiateMonsterObj()
        {
            int MonsterNum = FightEditorContrler.GetInstantiate().GetMonsterGroupEditorData(m_RoundInScene).Count;

            FightEditorContrler.GetInstantiate().SetMonsterTroopType(ObjectSelf.GetInstance().LimitFightMgr.m_MonsterTroopType);
            FightEditorContrler.GetInstantiate().SetBeginFightCount(ObjectSelf.GetInstance().LimitFightMgr.m_RoundNum);

            for (int i = 0; i < MonsterNum; ++i)
            {
                int                 nTableID  = SceneObjectManager.GetInstance().GetMosnterBundleRes(m_RoundInTotal, i);
                MonsterTemplate     pRow      = (MonsterTemplate)DataTemplate.GetInstance().m_MonsterTable.getTableData(nTableID);
                ArtresourceTemplate art       = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(pRow.getArtresources());
                string              _res      = art.getArtresources();
                GameObject          _AssetRes = AssetLoader.Inst.GetAssetRes(_res);
                GameObject          obj       = Instantiate(_AssetRes,
                                                            FightEditorContrler.GetInstantiate().GetMonsterGroupEditorData(m_RoundInScene)[i].MyPos,
                                                            FightEditorContrler.GetInstantiate().GetMonsterGroupEditorData(m_RoundInScene)[i].MyAngle) as GameObject;
                GameUtils.SetLayerRecursively(obj, FightEditorContrler.GetInstantiate().GetShadowCullMaskLayer());
                float _zoom = art.getArtresources_zoom() * pRow.getMonsterEnlarge();
                obj.transform.localScale = new UnityEngine.Vector3(_zoom, _zoom, _zoom);

                FightEditorContrler.GetInstantiate().SetMonsterBirthState(obj, FightEditorContrler.GetInstantiate().GetMonsterGroupEditorData(m_RoundInScene)[i], false);
                SceneObjectManager.GetInstance().SceneObjectAddMonster(obj, m_RoundInTotal, i);


                //Transform _body = null;
                //_body = obj.transform.FindChild("Body");
                //if (_body != null)
                //{
                //    _body.gameObject.SetActive(false);
                //    StartCoroutine(OnShowMonsterObj(_body));
                //}

                for (int m = 0, n = obj.transform.childCount; m < n; m++)
                {
                    obj.transform.GetChild(m).gameObject.SetActive(false);
                }
                StartCoroutine(OnShowMonsterObj(obj.transform));

                //怪物入场怒气加成 [10/17/2015 Zmy]
                AngertableTemplate _data = (AngertableTemplate)DataTemplate.GetInstance().m_AngerTable.getTableData(pRow.getFuryId());
                if (_data == null)
                {
                    continue;
                }

                m_EnemyPower.OnUpdatePowerValue(_data.getStartFury());
            }

//             //每波怪物初始化时候,初始敌方怒气值 [3/3/2015 Zmy]
//             if (m_RoundInScene - 1 >= 0 && m_RoundInScene - 1 < m_StageRow.m_waveFury.Length)
//             {
//                 int nValue = m_StageRow.m_waveFury[m_RoundInScene - 1];
//                 m_EnemyPower.OnUpdatePowerValue(nValue);
//             }

            //初始化释放怪物的被动技能 [7/31/2015 Zmy]
            SceneObjectManager.GetInstance().OnMonsterFreePassiveSpell();

            // add by zcd
            SetFightState(FightState.prepareEnemy_over);
        }