| | |
| | | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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(); |
| | |
| | | // 更新波索引 |
| | | ++CurrentWaveIndex; |
| | | EndlessBuffManager.instance.UpdateBuffList(); |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessCompletedPort, Level, CurrentWaveIndex); |
| | | |
| | | if (CurrentWaveIndex >= TotalWaves) |
| | | // 当前关卡的所有波次全部完成 |