| | |
| | | using TowerDefense.Agents; |
| | | using TowerDefense.Agents.Data; |
| | | using TowerDefense.Nodes; |
| | | using TowerDefense.UI.HUD; |
| | | |
| | | namespace TowerDefense.Level |
| | | { |
| | |
| | | |
| | | protected virtual void SpawnCurrent() |
| | | { |
| | | if (EndlessGameUI.instance.state == EndlessGameUI.State.GameOver) |
| | | { |
| | | StopWave(); |
| | | // 让所有兵线上已经生成的所有agent播放一个死亡动画然后销毁 |
| | | WaveLineAgentInsMgr[] waveLineAgentIns = AgentInsManager.instance.GetWaveLineList(); |
| | | |
| | | for (int i = 0; i < waveLineAgentIns.Length; ++i) |
| | | { |
| | | while (waveLineAgentIns[i].listAgent.Count > 0) |
| | | { |
| | | waveLineAgentIns[i].listAgent[0].PlayDeath(); |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | |
| | | if (isWaveStoped) return; |
| | | |
| | | if (!TrySetupNextSpawn()) |
| | |
| | | |
| | | // 木属性小怪需要同时生成两个,先这么写吧(WTF) |
| | | bool isDouble = enemyData.resource == 103; |
| | | |
| | | Poolable agentPoolable = Poolable.TryGetPoolable<Poolable>(AgentConfigurationList[index].agentPrefab.gameObject); |
| | | Agent newAgent = agentPoolable.GetComponent<Agent>(); |
| | | GameObject prefab = Resources.Load<GameObject>($"Prefabs/Enemies/{enemyData.resource}"); |
| | | GameObject obj = Instantiate(prefab); |
| | | Agent newAgent = obj.GetComponent<Agent>(); |
| | | newAgent.EnemyData = enemyData; |
| | | newAgent.transform.position = StartingNode.transform.position; |
| | | |
| | |
| | | |
| | | if (isDouble) |
| | | { |
| | | Poolable agentPoolable2 = Poolable.TryGetPoolable<Poolable>(AgentConfigurationList[index].agentPrefab.gameObject); |
| | | Agent doubleAgent = agentPoolable2.GetComponent<Agent>(); |
| | | obj = Instantiate(prefab); |
| | | Agent doubleAgent = obj.GetComponent<Agent>(); |
| | | doubleAgent.EnemyData = enemyData; |
| | | doubleAgent.transform.position = StartingNode.transform.position; |
| | | |