liuzhiwei
2020-10-29 22d482183aa44aa2ffd837d8939a7b0bd15d28b9
Assets/Scripts/TowerDefense/Level/EndlessWaveManager.cs
@@ -170,7 +170,7 @@
        private void RefreshBoss()
        {
            if (CurrentWaveIndex > 0)
            if (CurrentWaveIndex > 0 || TotalWaves == 1)
                EndlessBossHPManager.instance.SwitchHP(CurrentWaveIndex == TotalWaves - 1);
            EndlessBossHPManager.instance.SetBossInfo($"{waveData[0].Config.boss_name}  Lv.{Level}");
            EndlessBossHPManager.instance.UpdateWave(TotalWaves - CurrentWaveIndex);
@@ -197,8 +197,10 @@
            for (int i = 0; i < waveData.Count; ++i)
            {
                int tunel = waveData[i].Config.tunel;
                TunelList[tunel - 1].material = Resources.Load<Material>($"{tunelMaterialPath}{tunel}");
                GameObject obj = Resources.Load<GameObject>($"{faZhenPath}{tunel}");
                int tunelBgId = waveData[i].Config.tunel_bg;
                TunelList[tunel - 1].material = Resources.Load<Material>($"{tunelMaterialPath}{tunelBgId}");
                GameObject obj = Resources.Load<GameObject>($"{faZhenPath}{tunelBgId}");
                GameObject faZhen = Instantiate(obj);
                faZhen.transform.SetParent(TunelList[tunel - 1].gameObject.transform);
                faZhen.transform.localPosition = new Vector3(0, 1, 0);
@@ -206,7 +208,7 @@
                TunelList[tunel - 1].gameObject.SetActive(true);
                ParticleSystem ps = faZhen.transform.GetChild(0).GetComponent<ParticleSystem>();
                ps.Play();
                Destroy(ps.gameObject, ps.main.duration * 3);
                Destroy(faZhen, ps.main.duration * 3);
            }
            RefreshBoss();
@@ -299,6 +301,7 @@
                // 更新波索引
                ++CurrentWaveIndex;
                EndlessBuffManager.instance.UpdateBuffList();
                EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessCompletedPort, Level, CurrentWaveIndex);
                if (CurrentWaveIndex >= TotalWaves)
                    // 当前关卡的所有波次全部完成