|
@@ -15,13 +15,11 @@ namespace GameFrameworkYLSJ
|
|
|
public class ProcedureDefenseEntry : ProcedureBase
|
|
|
{
|
|
|
ProcedureOwner _owner;
|
|
|
- static public int nowWaveIndex = 0;
|
|
|
sm_cfg_duplicate_defense defenseMo;
|
|
|
public override void OnEnter(ProcedureOwner procedureOwner)
|
|
|
{
|
|
|
base.OnEnter(procedureOwner);
|
|
|
this._owner = procedureOwner;
|
|
|
- nowWaveIndex = 0;
|
|
|
TaskEventProcessor.Instance.Init();
|
|
|
GameDateManager.Instance.lastBattleType = BattleDefine.EBattleSceneType.EBattleType_Defense;
|
|
|
sm_gate gateInfo = sm_gate.GetMoById(UserProxy.Instance.player.newMap.curMapId);
|
|
@@ -36,17 +34,8 @@ namespace GameFrameworkYLSJ
|
|
|
UI_BaseMainWindow.Instance().SetDefenseWindow(true, tips);
|
|
|
UI_BaseMainWindow.Instance().SetDefenseEscapeNum(0, defenseMo.escapeNum);
|
|
|
LogHelper.Log("ProcedureNoviceGuideEntry");
|
|
|
- TimeControl.Instance.GameNormal();
|
|
|
TimeControl.Instance.SelfTimeNormal();
|
|
|
TimeControl.Instance.EnemyTimeNormal();
|
|
|
- //GameObject cameraObj = CameraManager.Instance.CameraManagerObj.transform.Find("Main Camera").gameObject;
|
|
|
- //Camera c = cameraObj.GetComponent<Camera>();
|
|
|
- //c.tag = "MainCamera";
|
|
|
- //c.depth = 1;
|
|
|
- //PanelHelper.Instance.ShowPanel("YL_FunctionGuide", (panel) =>
|
|
|
- //{
|
|
|
- //});
|
|
|
-
|
|
|
TimeControl.Instance.GameNormal();
|
|
|
|
|
|
EventComponent e = GameEntry.GetComponent<EventComponent>();
|
|
@@ -58,8 +47,6 @@ namespace GameFrameworkYLSJ
|
|
|
UI_TaskTracking.ShowState(false);
|
|
|
UI_TipsWindow.InitStaticDialog("守卫言灵女神","请迅速清理来犯的敌人!", null, 3);
|
|
|
// 通过无尽关卡数据 初始化 孵化器
|
|
|
- sm_gate gateMo = sm_gate.GetMoById(GameDateManager.Instance.GateID);
|
|
|
- CreateEndlessMonster();
|
|
|
ChangeState<ProcedureDefenseInGame>(_owner);
|
|
|
}
|
|
|
|
|
@@ -71,47 +58,6 @@ namespace GameFrameworkYLSJ
|
|
|
e.Unsubscribe(User_AddItemEvent.EventId, X2Battle.X2BattleManager.EquipWeapOrYanling);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- public void CreateEndlessMonster()
|
|
|
- {
|
|
|
- string[] waveStr = defenseMo.monsterList.Split('|');
|
|
|
- SpawnerSystem.Instance.crateGroupMax = waveStr.Length;
|
|
|
- SpawnerSystem.Instance.crateGroupNowNum = ProcedureEndlessEntry.nowWaveIndex + 1;
|
|
|
- if (nowWaveIndex >= waveStr.Length)
|
|
|
- {
|
|
|
- RoleManager.Instance.GameWin();
|
|
|
- return;
|
|
|
- }
|
|
|
- string monsterStr = waveStr[nowWaveIndex];
|
|
|
- string[] monsterListStr = monsterStr.Split(',');
|
|
|
- SpawnerNodeBase spNode = GameObject.Find("Spawners").transform.Find("Spawner").GetComponent<SpawnerNodeBase>();
|
|
|
- int guide = 0;
|
|
|
- foreach (var item in monsterListStr)
|
|
|
- {
|
|
|
- string[] monsterInfo = item.Split('_');
|
|
|
- int monsterId = int.Parse(monsterInfo[0]);
|
|
|
- int monsterNum = int.Parse(monsterInfo[1]);
|
|
|
-
|
|
|
- GameObject spNewNodeObj = GameObject.Instantiate(spNode.gameObject, spNode.transform.parent);
|
|
|
-
|
|
|
- SpawnerNodeBase spNewNode = spNewNodeObj.GetComponent<SpawnerNodeBase>();
|
|
|
- spNewNode.index = guide;
|
|
|
- spNewNode.gameObject.name = "spawner" + nowWaveIndex + "_" + (guide + 1).ToString();
|
|
|
- spNewNode.maxNum = monsterNum;
|
|
|
- ZoneSpawnerLogic logic;
|
|
|
- if (!spNewNode.gameObject.TryGetComponent<ZoneSpawnerLogic>(out logic))
|
|
|
- {
|
|
|
- spNewNode.gameObject.AddComponent<ZoneSpawnerLogic>();
|
|
|
- }
|
|
|
- SpawnPoint point = spNewNodeObj.transform.GetChild(0).GetComponent<SpawnPoint>();
|
|
|
- point.unitId = monsterId;
|
|
|
- spNewNodeObj.gameObject.SetActive(true);
|
|
|
- ++guide;
|
|
|
-
|
|
|
- }
|
|
|
- nowWaveIndex++;
|
|
|
- }
|
|
|
|
|
|
}
|
|
|
}
|