hch
2025-12-03 e30ee01e9b30c2861192afcbba84f7c6fba90fca
0312 增加切换章节 副本加载; 调整自动的响应速度
5个文件已修改
2个文件已添加
112 ■■■■■ 已修改文件
Main/System/Battle/BaseBattleWin.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleField/OperationAgent/AutoModeOperationAgent.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleManager.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Launch/MapLoadingWin.cs 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Launch/MapLoadingWin.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Settlement/BattleVictoryWin.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BaseBattleWin.cs
@@ -37,6 +37,7 @@
    protected override void OnPreOpen()
    {
        base.OnPreOpen();
        UIManager.Instance.CloseWindow<MapLoadingWin>();
        BattleManager.Instance.onBattleFieldCreate += OnCreateBattleField;
        RegisterBattleEvents();
Main/System/Battle/BattleField/OperationAgent/AutoModeOperationAgent.cs
@@ -13,7 +13,7 @@
    public override void Run()
    {
        //最低1秒
        if (Time.time - lastTime < 1f)
        if (Time.time - lastTime < 0.2f)
            return;
        lastTime = Time.time;
        if (AutoFightModel.Instance.isPause)
Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs
@@ -18,7 +18,7 @@
        base.Run();
        if (autoNext)
        {
            if (Time.time - lastTime < 0.2f)
            if (Time.time - lastTime < 0.1f)
                return;
            lastTime = Time.time;
            if (storyBattleField.RequestFight())
Main/System/Battle/BattleManager.cs
@@ -636,6 +636,10 @@
        }
        GameNetSystem.Instance.SendInfo(pack);
        Debug.Log("战斗时序 发起 " + Time.time);
        if (mapID != 1)
        {
            UIManager.Instance.OpenWindow<MapLoadingWin>();
        }
    }
    // 获取当前正在显示的战斗场景名称,如果没有则返回空字符串
Main/System/Launch/MapLoadingWin.cs
New file
@@ -0,0 +1,76 @@
using DG.Tweening;
using UnityEngine;
using UnityEngine.UI;
public class MapLoadingWin : UIBase
{
    [Header("加载地图时长毫秒")]
    public int millSeconds = 1000;
    [Header("超过时长自动关闭毫秒")]
    public int autoCloseMillSeconds = 3000;
    [Header("洞缩小的时长毫秒")]
    public int holeCloseMillSeconds = 1000;
    [SerializeField] Transform fbLoadRect;
    [SerializeField] Image holeLoadImg;
    [SerializeField] Transform chapterLoadRect;
    [SerializeField] Text chapterName;
    [SerializeField] Text mapName;
    [SerializeField] Text processText;
    float showTime = 0;
    int closeTime = 0;
    protected override void OnPreOpen()
    {
        showTime = Time.time;
        if (functionOrder == 0)
        {
            fbLoadRect.SetActive(true);
            chapterLoadRect.SetActive(false);
            //副本切换
            holeLoadImg.SetNativeSize();
            //holeLoadImg的宽高同比1秒内缩小到0,但是不用scale的方式
            var rect = holeLoadImg.GetComponent<RectTransform>();
            rect.DOSizeDelta(new Vector2(0, 0), holeCloseMillSeconds / 1000f);
            closeTime = autoCloseMillSeconds;
        }
        else
        {
            //章节切换
            chapterLoadRect.SetActive(true);
            fbLoadRect.SetActive(false);
            int num = PlayerDatas.Instance.baseData.ExAttr1 / 10000;
            chapterName.text = Language.Get("MapLoad1", UIHelper.ChineseNumber(num));
            mapName.text = MainChapterConfig.Get(num).ChapterName;
            processText.text = Language.Get("MapLoad2","0");
            closeTime = millSeconds;
        }
    }
    protected override void OnPreClose()
    {
    }
    protected void LateUpdate()
    {
        var passTime = Time.time - showTime;
        if (passTime > closeTime / 1000f)
        {
            CloseWindow();
        }
        if (functionOrder != 0)
        {
            var num = (int)(passTime*1000 / closeTime * 100) % 100;
            if (num % 6 == 0)
            {
                processText.text = Language.Get("MapLoad2", num);
            }
        }
    }
}
Main/System/Launch/MapLoadingWin.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 757f19ce49125ef4fa60d9c08fe48885
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/System/Settlement/BattleVictoryWin.cs
@@ -75,7 +75,7 @@
    [SerializeField] ScrollerController scroller;
    string battleName = BattleConst.StoryBossBattleField;
    string battleName = BattleConst.StoryBossBattleField;   //绑死战场就不通用了根据情况修改
    protected override void OnPreOpen()
    {
        scroller.OnRefreshCell += OnRefreshCell;
@@ -87,6 +87,8 @@
    {
        scroller.OnRefreshCell -= OnRefreshCell;
        BattleSettlementManager.Instance.WinShowOver(battleName);
        // 如果点击回放等,请根据表现情况不表现加载
        OpenLoading();
    }
    List<Item> showItems = new List<Item>();
@@ -108,13 +110,13 @@
        var resultStr = jsonData["itemInfo"];
        for (int i = 0; i < resultStr.Count; i++)
        {
        {
            showItems.Add(new Item((int)resultStr[i]["ItemID"], (long)resultStr[i]["Count"]));
        }
        showItems.Sort(SortItem);
        for (int i = 0; i < showItems.Count; i++)
        {
        {
            scroller.AddCell(ScrollerDataType.Header, i);
        }
        scroller.Restart();
@@ -139,4 +141,12 @@
        _cell?.Display(item.id, item.countEx);
    }
    void OpenLoading()
    {
        if (PlayerDatas.Instance.baseData.ExAttr1 / 100 % 100 == 1)
        {
            UIManager.Instance.OpenWindow<MapLoadingWin>(1);
        }
    }
}