| | |
| | | |
| | | LoadMap(MapID); |
| | | |
| | | // 清空当前战场的血量记录(防止不同战斗之间的数据混乱) |
| | | if (BattleHeroInfoBar.largestPackUID.ContainsKey(guid)) |
| | | { |
| | | BattleHeroInfoBar.largestPackUID.Remove(guid); |
| | | } |
| | | if (BattleHeroInfoBar.largestPackUIDAllObjectsToHp.ContainsKey(guid)) |
| | | { |
| | | BattleHeroInfoBar.largestPackUIDAllObjectsToHp.Remove(guid); |
| | | } |
| | | if (BattleHeroInfoBar.largestPackUIDAllObjectsMaxHp.ContainsKey(guid)) |
| | | { |
| | | BattleHeroInfoBar.largestPackUIDAllObjectsMaxHp.Remove(guid); |
| | | } |
| | | |
| | | // battleRootNode.SetBackground(ResManager.Instance.LoadAsset<Texture>("Texture/FullScreenBg", "mainui_img_277")); |
| | | |
| | | SetBattleStartState(); |
| | |
| | | |
| | | // 清理死亡处理记录 |
| | | processingDeathObjIds.Clear(); |
| | | |
| | | // 清空当前战场的血量记录 |
| | | if (BattleHeroInfoBar.largestPackUID.ContainsKey(guid)) |
| | | { |
| | | BattleHeroInfoBar.largestPackUID.Remove(guid); |
| | | } |
| | | if (BattleHeroInfoBar.largestPackUIDAllObjectsToHp.ContainsKey(guid)) |
| | | { |
| | | BattleHeroInfoBar.largestPackUIDAllObjectsToHp.Remove(guid); |
| | | } |
| | | if (BattleHeroInfoBar.largestPackUIDAllObjectsMaxHp.ContainsKey(guid)) |
| | | { |
| | | BattleHeroInfoBar.largestPackUIDAllObjectsMaxHp.Remove(guid); |
| | | } |
| | | } |
| | | |
| | | public virtual void Run() |
| | |
| | | if (State == 4) |
| | | { |
| | | //已经结束并结算 |
| | | Debug.Log("战斗结束"); |
| | | // Debug.Log("战斗结束"); |
| | | rejectNewPackage = true; |
| | | OnBattleEnd(turnFightStateData); |
| | | return; |
| | |
| | | { |
| | | if (State == 2) |
| | | { |
| | | Debug.Log("战斗开始"); |
| | | // Debug.Log("战斗开始"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Debug.Log("战斗回合 : " + turnNum + ",状态 " + State); |
| | | // Debug.Log("战斗回合 : " + turnNum + ",状态 " + State); |
| | | } |
| | | |
| | | DistributeNextPackage(); |
| | |
| | | // 检查是否已经在处理死亡 |
| | | if (processingDeathObjIds.Contains(objID)) |
| | | { |
| | | Debug.LogWarning($"OnObjsDead: 角色正在处理死亡,忽略重复死亡消息 ObjID={objID}"); |
| | | // Debug.LogWarning($"OnObjsDead: 角色正在处理死亡,忽略重复死亡消息 ObjID={objID}"); |
| | | continue; |
| | | } |
| | | |
| | | BattleObject battleObj = battleObjMgr.GetBattleObject((int)objID); |
| | | if (battleObj == null) |
| | | { |
| | | Debug.LogWarning($"OnObjsDead: 找不到角色 ObjID={objID}"); |
| | | Debug.LogError($"OnObjsDead: 找不到角色 ObjID={objID}"); |
| | | continue; |
| | | } |
| | | |
| | |
| | | |
| | | // 清理死亡处理记录 |
| | | processingDeathObjIds.Clear(); |
| | | |
| | | // 清空当前战场的血量记录 |
| | | if (BattleHeroInfoBar.largestPackUID.ContainsKey(guid)) |
| | | { |
| | | BattleHeroInfoBar.largestPackUID.Remove(guid); |
| | | } |
| | | if (BattleHeroInfoBar.largestPackUIDAllObjectsToHp.ContainsKey(guid)) |
| | | { |
| | | BattleHeroInfoBar.largestPackUIDAllObjectsToHp.Remove(guid); |
| | | } |
| | | if (BattleHeroInfoBar.largestPackUIDAllObjectsMaxHp.ContainsKey(guid)) |
| | | { |
| | | BattleHeroInfoBar.largestPackUIDAllObjectsMaxHp.Remove(guid); |
| | | } |
| | | |
| | | // ===== 新增:卸载蓝队资源 ===== |
| | | BattleResManager.Instance.UnloadBattleResources(guid); |