From 170e8516ae6d6082b94a762e06c491fddfe7fd0f Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 05 十一月 2025 16:47:27 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts

---
 Main/System/InternalAffairs/GoldRushTentCell.cs |   14 +++++++++++++-
 Main/System/InternalAffairs/GoldRushLeader.cs   |   12 ++++++++++--
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/Main/System/InternalAffairs/GoldRushLeader.cs b/Main/System/InternalAffairs/GoldRushLeader.cs
index 584a2c3..a7f346e 100644
--- a/Main/System/InternalAffairs/GoldRushLeader.cs
+++ b/Main/System/InternalAffairs/GoldRushLeader.cs
@@ -164,8 +164,9 @@
         {
             leaderWord.SetActive(true);
             leaderWord.Play();
-            leaderText.text = Language.Get(!pathPosEvent.m_IsRandom ? pathPosEvent.m_Text1 : 
+            leaderText.text = Language.Get(!pathPosEvent.m_IsRandom ? pathPosEvent.m_Text1 :
                 pathPosEvent.m_Text1 + UnityEngine.Random.Range((int)pathPosEvent.m_Value1, (int)pathPosEvent.m_Value2 + 1));
+            ForceRefreshLayout();
         }
         else if (pathPosEvent.m_PosEvent == PosEvent.TargetWord)
         {
@@ -211,6 +212,13 @@
 
     }
 
-
+    /// <summary>
+    /// 寮哄埗鍒锋柊Layout锛岃В鍐冲祵濂桳ayout鍜孋ontentSizeFitter鐨勯噸鍙犻棶棰�
+    /// </summary>
+    async UniTask ForceRefreshLayout()
+    {
+        await UniTask.DelayFrame(2);
+        LayoutRebuilder.ForceRebuildLayoutImmediate(leaderWord.GetComponent<RectTransform>());
+    }
 }
 
diff --git a/Main/System/InternalAffairs/GoldRushTentCell.cs b/Main/System/InternalAffairs/GoldRushTentCell.cs
index 78ddfac..139b8d7 100644
--- a/Main/System/InternalAffairs/GoldRushTentCell.cs
+++ b/Main/System/InternalAffairs/GoldRushTentCell.cs
@@ -4,6 +4,7 @@
 using DG.Tweening;
 using System.Linq;
 using System;
+using Cysharp.Threading.Tasks;
 
 //宸ヤ汉鏄浐瀹氱殑璺熼殢妯″紡锛岀洃宸ユ槸闅忔満鍒嗛厤鐨勶紝鍦轰笂鐨勭洃宸ユ暟閲忎細姣斿疄闄呮洿澶�
 //鍒嗛厤鐩戝伐
@@ -421,6 +422,7 @@
             wordArr[index].SetActive(true);
             wordArr[index].Play();
             textArr[index].text = Language.Get(content);
+            ForceRefreshLayout();
         }
         else if (posEvent == PosEvent.TargetAction)
         {
@@ -432,7 +434,17 @@
 
     }
 
-
+    /// <summary>
+    /// 寮哄埗鍒锋柊Layout锛岃В鍐冲祵濂桳ayout鍜孋ontentSizeFitter鐨勯噸鍙犻棶棰�
+    /// </summary>
+    async UniTask ForceRefreshLayout()
+    {
+        await UniTask.DelayFrame(2);
+        foreach (var word in wordArr)
+        {
+            LayoutRebuilder.ForceRebuildLayoutImmediate(word.GetComponent<RectTransform>());
+        }
+    }
 
 
     void AssignLeader(int addCount)

--
Gitblit v1.8.0