chenxin
2020-11-05 d6161eec964b2eeb23bd93c84c29f8ffd3a2d06f
Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs
@@ -694,6 +694,7 @@
        /// <param name="opponent"></param>
        public void DestroyTowerGrid(int xidx)
        {
            // cx test 这里的逻辑已经不走了
            for (int i = 0; i < AttackRowNumbers; ++i)
            {
                if (TowerDestroyArr[xidx, i]) continue;
@@ -753,11 +754,38 @@
                    }
                }
                // 红心减少逻辑
                // HealthHeartState.instance.killHeart(false);
                GameOver();
                overTimer = new Timer(1.2f, SafelyCallGameOverEvent);
            }
        }
        /// <summary>
        /// 爱心数量为0,游戏结束
        /// </summary>
        private void AllHeartLose()
        {
            // 清理技能
            EndlessBossSkillManager.instance.ClearSkillList();
            // 停止所有兵线的出兵
            for (int i = 0; i < TotalWaveLines; ++i)
            {
                EndlessLevelManager.instance.StopWaveLine(i);
            }
            // 让所有兵线上已经生成的所有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();
                }
            }
            GameOver();
            overTimer = new Timer(1.2f, SafelyCallGameOverEvent);
        }
        private void SafelyCallGameOverEvent()
@@ -1527,6 +1555,7 @@
            if (placeObj != null)
                m_CurrentArea = placeObj.GetComponent<IPlacementArea>();
            placeObj = GameObject.FindGameObjectWithTag("PlaceTowerOpponent");
            EventCenter.Ins.Add((int)KTGMGemClient.EventType.EndlessHeartAllLose, AllHeartLose);
        }
        /// <summary>