根据提供的code differences信息,由于没有具体的代码变更内容,我将生成一个通用的commit message模板:
``` docs(readme): 更新文档说明 - 添加项目使用指南 - 完善API接口说明 - 修正错误的配置示例 ``` 注意:由于您提供的code differences部分为空,以上是一个示例模板。当您有具体的代码变更时,请提供详细的变更内容以便生成更准确的commit message。
This commit is contained in:
1 parent
11f1af357d
commit
7d9d0f52d1
83 files changed
+3510
-1493
No files matched your search
@@ -59,6 +59,19 @@ public class DefenseWaveLevelController : MonoBehaviour
|
||||
if (autoStart) StartCoroutine(RunLevel());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 外部调用:开始关卡(用于游戏流程控制)
|
||||
/// </summary>
|
||||
public IEnumerator StartLevel()
|
||||
{
|
||||
if (level == null || level.waves == null || level.waves.Length == 0)
|
||||
{
|
||||
Debug.LogError("DefenseWaveLevelController: 无法启动关卡,波次数据未加载");
|
||||
yield break;
|
||||
}
|
||||
yield return RunLevel();
|
||||
}
|
||||
|
||||
private bool LoadLevel()
|
||||
{
|
||||
if (levelJson == null)
|
||||
@@ -88,12 +101,29 @@ public class DefenseWaveLevelController : MonoBehaviour
|
||||
yield return new WaitForSeconds(Mathf.Max(0f, wave.restBeforeWave));
|
||||
yield return SpawnWave(wave);
|
||||
yield return WaitForWaveCleared();
|
||||
|
||||
// 每波结束后,让英雄回到初始位置
|
||||
ResetHeroPositionsAfterWave();
|
||||
|
||||
yield return new WaitForSeconds(Mathf.Max(0f, waveCompleteDelay));
|
||||
}
|
||||
|
||||
UpdateProgress(level.waves.Length, level.waves.Length, "通关");
|
||||
Debug.Log("DefenseWaveLevelController: 第一关波次全部完成。");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 每波结束后让英雄回到初始位置
|
||||
/// </summary>
|
||||
private void ResetHeroPositionsAfterWave()
|
||||
{
|
||||
DefenseGameFlowController flowController = FindObjectOfType<DefenseGameFlowController>();
|
||||
if (flowController != null)
|
||||
{
|
||||
flowController.ResetHeroPositions();
|
||||
Debug.Log($"第 {currentWaveIndex + 1} 波结束,英雄回到初始位置");
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator SpawnWave(WaveEntry wave)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user