From d1c226e7178df2a1cfc164e0c474d1b1840e9df8 Mon Sep 17 00:00:00 2001 From: daixiawu Date: Wed, 27 May 2026 14:21:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=88=BF=E9=97=B4=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E8=BF=AD=E4=BB=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIOutsideMultiplayCreateRoomPanelMono.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Unity/Assets/Scripts/TH1_UI/View/Outside/UIOutsideMultiplayCreateRoomPanelMono.cs b/Unity/Assets/Scripts/TH1_UI/View/Outside/UIOutsideMultiplayCreateRoomPanelMono.cs index 0c8ef13d6..c5208e32a 100644 --- a/Unity/Assets/Scripts/TH1_UI/View/Outside/UIOutsideMultiplayCreateRoomPanelMono.cs +++ b/Unity/Assets/Scripts/TH1_UI/View/Outside/UIOutsideMultiplayCreateRoomPanelMono.cs @@ -205,11 +205,13 @@ namespace TH1_UI.View.Outside EnsureRoomNameHint(); if (RoomNameHintText != null) RoomNameHintText.text = hint; if (RoomNameHintObject != null) RoomNameHintObject.SetActive(true); + RebuildPanelLayout(); } private void HideRoomNameHint() { if (RoomNameHintObject != null) RoomNameHintObject.SetActive(false); + RebuildPanelLayout(); } private void ShowPasswordHint() @@ -217,11 +219,13 @@ namespace TH1_UI.View.Outside EnsurePasswordHint(); if (PasswordHintText != null) PasswordHintText.text = "请输入4位数字密码"; if (PasswordHintObject != null) PasswordHintObject.SetActive(true); + RebuildPanelLayout(); } private void HidePasswordHint() { if (PasswordHintObject != null) PasswordHintObject.SetActive(false); + RebuildPanelLayout(); } private RoomKind GetRoomKind() @@ -288,6 +292,15 @@ namespace TH1_UI.View.Outside if (target == null) return; Canvas.ForceUpdateCanvases(); LayoutRebuilder.ForceRebuildLayoutImmediate(target); + RebuildPanelLayout(); + } + + private void RebuildPanelLayout() + { + var target = GetRoot().transform as RectTransform; + if (target == null || !target.gameObject.activeInHierarchy) return; + Canvas.ForceUpdateCanvases(); + LayoutRebuilder.ForceRebuildLayoutImmediate(target); } private void EnsurePasswordHint()