//实例化怪物 [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); }