From e30ee01e9b30c2861192afcbba84f7c6fba90fca Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 03 十二月 2025 00:56:29 +0800
Subject: [PATCH] 0312 增加切换章节 副本加载; 调整自动的响应速度

---
 Main/System/Launch/MapLoadingWin.cs.meta                                |   11 +++++
 Main/System/Battle/BattleManager.cs                                     |    4 ++
 Main/System/Battle/BattleField/OperationAgent/AutoModeOperationAgent.cs |    2 
 Main/System/Battle/BaseBattleWin.cs                                     |    1 
 Main/System/Settlement/BattleVictoryWin.cs                              |   16 ++++++-
 Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs |    2 
 Main/System/Launch/MapLoadingWin.cs                                     |   76 ++++++++++++++++++++++++++++++++++++++
 7 files changed, 107 insertions(+), 5 deletions(-)

diff --git a/Main/System/Battle/BaseBattleWin.cs b/Main/System/Battle/BaseBattleWin.cs
index 5088f75..b6e68ed 100644
--- a/Main/System/Battle/BaseBattleWin.cs
+++ b/Main/System/Battle/BaseBattleWin.cs
@@ -37,6 +37,7 @@
     protected override void OnPreOpen()
     {
         base.OnPreOpen();
+        UIManager.Instance.CloseWindow<MapLoadingWin>();
         BattleManager.Instance.onBattleFieldCreate += OnCreateBattleField;
         RegisterBattleEvents();
 
diff --git a/Main/System/Battle/BattleField/OperationAgent/AutoModeOperationAgent.cs b/Main/System/Battle/BattleField/OperationAgent/AutoModeOperationAgent.cs
index d904ee1..4c2b3a7 100644
--- a/Main/System/Battle/BattleField/OperationAgent/AutoModeOperationAgent.cs
+++ b/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)
diff --git a/Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs b/Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs
index 954ba4a..c4f1ed9 100644
--- a/Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs
+++ b/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())
diff --git a/Main/System/Battle/BattleManager.cs b/Main/System/Battle/BattleManager.cs
index 14656c6..f19be2d 100644
--- a/Main/System/Battle/BattleManager.cs
+++ b/Main/System/Battle/BattleManager.cs
@@ -636,6 +636,10 @@
         }
         GameNetSystem.Instance.SendInfo(pack);
         Debug.Log("鎴樻枟鏃跺簭 鍙戣捣 " + Time.time);
+        if (mapID != 1)
+        {
+            UIManager.Instance.OpenWindow<MapLoadingWin>();
+        }
     }
 
     // 鑾峰彇褰撳墠姝e湪鏄剧ず鐨勬垬鏂楀満鏅悕绉帮紝濡傛灉娌℃湁鍒欒繑鍥炵┖瀛楃涓�
diff --git a/Main/System/Launch/MapLoadingWin.cs b/Main/System/Launch/MapLoadingWin.cs
new file mode 100644
index 0000000..f6ba294
--- /dev/null
+++ b/Main/System/Launch/MapLoadingWin.cs
@@ -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锛屼絾鏄笉鐢╯cale鐨勬柟寮�
+            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);
+            }
+        }
+    }
+
+}
\ No newline at end of file
diff --git a/Main/System/Launch/MapLoadingWin.cs.meta b/Main/System/Launch/MapLoadingWin.cs.meta
new file mode 100644
index 0000000..544cb8e
--- /dev/null
+++ b/Main/System/Launch/MapLoadingWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 757f19ce49125ef4fa60d9c08fe48885
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/Settlement/BattleVictoryWin.cs b/Main/System/Settlement/BattleVictoryWin.cs
index e327122..e6b3f8e 100644
--- a/Main/System/Settlement/BattleVictoryWin.cs
+++ b/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);
+        }
+    }
 }
\ No newline at end of file

--
Gitblit v1.8.0