hch
2025-11-20 ed98029a88cd89702980ac7c40b711afddc5aeb2
Main/System/Battle/BattleManager.cs
@@ -2,6 +2,7 @@
using UnityEngine;
using LitJson;
using System;
using System.Linq;
public class BattleManager : GameSystemManager<BattleManager>
{
@@ -146,6 +147,7 @@
        {
            if (!allow)
            {
                _package.socketType = ServerType.MainFight;
                packQueue.Enqueue(_package);
            }
        }
@@ -168,6 +170,7 @@
        List<GameNetPackBasic> newPackList = ParseBattlePackList(string.Empty, packQueueSnapshot);
#if UNITY_EDITOR
        Action printNewPack = () =>
        {
            string temp = "After AnalysisPackQueueAndDistribute newPackList count: " + newPackList.Count + "\n";
@@ -190,7 +193,7 @@
        };
        printNewPack();
#endif
        // HashSet<int> skipIndexes = new HashSet<int>();
        // // 这里已经是按照Dequeue的顺序了
@@ -276,11 +279,11 @@
    public static List<GameNetPackBasic> ParseBattlePackList(string guid, List<GameNetPackBasic> packQueueSnapshot)
    {
        var list = CustomHB426CombinePack.CombineToSkillPackFromList(guid, packQueueSnapshot);
        string str = "ParseBattlePackList \n";
        for (int i = 0; i < list.Count; i++)
        {
            str += "  " + list[i].GetType().Name + "\n";
        }
        // string str = "ParseBattlePackList \n";
        // for (int i = 0; i < list.Count; i++)
        // {
        //     str += "  " + list[i].GetType().Name + "\n";
        // }
        // BattleDebug.LogError(str);
        return list;
@@ -659,4 +662,16 @@
        }
        return null;
    }
    public void DestroyAllBattleField()
    {
        var battleFieldsList = battleFields.Values.ToList();
        foreach (var battleField in battleFieldsList)
        {
            if (battleField == null)
                continue;
            battleField.Destroy();
        }
    }
}