From cc733775726b6f1816b4997004fcb9f73d00678f Mon Sep 17 00:00:00 2001 From: daixiawu Date: Wed, 27 May 2026 23:28:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E6=9C=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefab/UI/Bottom/UIBottomBottomBar.prefab | 37 +++++++++++++++++++ .../Prefab/UI/Bottom/UIBottomNet.prefab | 3 +- .../View/Bottom/UIBottomBottomBarView.cs | 1 + .../TH1_UI/View/Bottom/UIBottomNetView.cs | 12 +++++- 4 files changed, 50 insertions(+), 3 deletions(-) diff --git a/Unity/Assets/Resources/Prefab/UI/Bottom/UIBottomBottomBar.prefab b/Unity/Assets/Resources/Prefab/UI/Bottom/UIBottomBottomBar.prefab index 4d6992f6f..f0614145c 100644 --- a/Unity/Assets/Resources/Prefab/UI/Bottom/UIBottomBottomBar.prefab +++ b/Unity/Assets/Resources/Prefab/UI/Bottom/UIBottomBottomBar.prefab @@ -1096,6 +1096,7 @@ RectTransform: - {fileID: 7747992246884234094} - {fileID: 892967444314090222} - {fileID: 3956951239660659384} + - {fileID: 2761173188244930348} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -1201,6 +1202,7 @@ MonoBehaviour: SLButton: {fileID: 7677067879999997292} RankingButton: {fileID: 4649407183905496781} WikiButton: {fileID: 5879810144992425802} + ChatAreaRoot: {fileID: 2761173188244930348} QuitPanel: {fileID: 7159509067703284630} NextTurnConfirmPanel: {fileID: 3395910451510361722} _tabUnitCount: 0 @@ -2872,6 +2874,41 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!1 &5526908458706181897 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2761173188244930348} + m_Layer: 5 + m_Name: ChatAreaRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2761173188244930348 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5526908458706181897} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7448979660496629192} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -131, y: -463} + m_SizeDelta: {x: 638.9909, y: 50} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &5922093555231887896 GameObject: m_ObjectHideFlags: 0 diff --git a/Unity/Assets/Resources/Prefab/UI/Bottom/UIBottomNet.prefab b/Unity/Assets/Resources/Prefab/UI/Bottom/UIBottomNet.prefab index f6a60b226..f8da03140 100644 --- a/Unity/Assets/Resources/Prefab/UI/Bottom/UIBottomNet.prefab +++ b/Unity/Assets/Resources/Prefab/UI/Bottom/UIBottomNet.prefab @@ -194,7 +194,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -671.3968, y: 408.8651} + m_AnchoredPosition: {x: -646, y: 379} m_SizeDelta: {x: 577.2065, y: 97.9193} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &2440790000169401958 @@ -331,6 +331,7 @@ MonoBehaviour: NetInfo: {fileID: 7448979660496629192} ScrollViewRect: {fileID: 7039295970119204888} ChatAreaRoot: {fileID: 7448979660496629192} + NetErrorPanelRoot: {fileID: 0} --- !u!1 &3830065821644900243 GameObject: m_ObjectHideFlags: 0 diff --git a/Unity/Assets/Scripts/TH1_UI/View/Bottom/UIBottomBottomBarView.cs b/Unity/Assets/Scripts/TH1_UI/View/Bottom/UIBottomBottomBarView.cs index 3f8d5bad4..f23449761 100644 --- a/Unity/Assets/Scripts/TH1_UI/View/Bottom/UIBottomBottomBarView.cs +++ b/Unity/Assets/Scripts/TH1_UI/View/Bottom/UIBottomBottomBarView.cs @@ -44,6 +44,7 @@ namespace TH1_UI.View.Bottom public Button SLButton; public Button RankingButton; public Button WikiButton; + public RectTransform ChatAreaRoot; public UIBottomBottomBarQuitPanelMono QuitPanel; public UIBottomBottomBarNextTurnConfirmPanelMono NextTurnConfirmPanel; diff --git a/Unity/Assets/Scripts/TH1_UI/View/Bottom/UIBottomNetView.cs b/Unity/Assets/Scripts/TH1_UI/View/Bottom/UIBottomNetView.cs index a72f7cefd..102f85086 100644 --- a/Unity/Assets/Scripts/TH1_UI/View/Bottom/UIBottomNetView.cs +++ b/Unity/Assets/Scripts/TH1_UI/View/Bottom/UIBottomNetView.cs @@ -11,6 +11,7 @@ using UnityEngine; using UnityEngine.UI; using RuntimeData; using TH1_Logic.Core; +using TH1_UI.Core; using UnityEngine.Serialization; namespace TH1_UI.View.Bottom @@ -182,7 +183,7 @@ namespace TH1_UI.View.Bottom return; } - var parent = ChatAreaRoot != null ? ChatAreaRoot : transform as RectTransform; + var parent = GetChatAreaRoot(); _chatAreaGo = Instantiate(prefab, parent); FitToRoot(_chatAreaGo.transform as RectTransform, parent); _chatArea = _chatAreaGo.GetComponent(); @@ -209,6 +210,13 @@ namespace TH1_UI.View.Bottom rectTransform.localScale = Vector3.one; } + private RectTransform GetChatAreaRoot() + { + var bottomBarRoot = ViewControllerManager.UIBottomBottomBarController?.WindowScript?.ChatAreaRoot; + if (bottomBarRoot != null) return bottomBarRoot; + return ChatAreaRoot != null ? ChatAreaRoot : transform as RectTransform; + } + private void CloseChatArea() { if (_chatArea != null) @@ -262,7 +270,7 @@ namespace TH1_UI.View.Bottom return NetErrorPanelRoot; } - return ChatAreaRoot != null ? ChatAreaRoot : transform as RectTransform; + return GetChatAreaRoot(); } private void CloseNetErrorArea()