lcy
15 小时以前 f1e5df1fc8eadd0eb27e0a6870501fa25a42b5a1
262 修复切换服务器报错
1个文件已修改
10 ■■■■ 已修改文件
Main/System/Battle/BattleManager.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleManager.cs
@@ -2,6 +2,7 @@
using UnityEngine;
using LitJson;
using System;
using System.Linq;
public class BattleManager : GameSystemManager<BattleManager>
{
@@ -662,13 +663,16 @@
    public void DestroyAllBattleField()
    {
        foreach (var kvp in battleFields)
        // 创建副本进行遍历,避免在遍历时修改原集合
        var battleFieldsList = battleFields.Values.ToList();
        foreach (var battleField in battleFieldsList)
        {
            BattleField battleField = kvp.Value;
            if (battleField == null)
                continue;
            DestroyBattleField(battleField);
        }
    }
}