From d15f0bc0ca39c33b99e482508d0f3cbfc6eaebe1 Mon Sep 17 00:00:00 2001 From: "DESKTOP-MMO982B\\User" <752966621@qq.com> Date: Wed, 4 Mar 2026 12:57:07 +0800 Subject: [PATCH] 1 --- .../ManagedResources/~Lua/Base/BasePanel.lua | 18 ++++++++++-------- .../~Lua/Modules/Battle/View/BattlePanel.lua | 4 ++-- .../~Lua/Modules/Chat/BattleChatPanel.lua | 18 +++++++++++++++--- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Base/BasePanel.lua b/Assets/ManagedResources/~Lua/Base/BasePanel.lua index 6ab941fd9a..99062f97bf 100644 --- a/Assets/ManagedResources/~Lua/Base/BasePanel.lua +++ b/Assets/ManagedResources/~Lua/Base/BasePanel.lua @@ -23,16 +23,18 @@ function BasePanel:CreateUI(gameObject) end ) end - MyPCall( - function() self:InitComponent() - end - ) - MyPCall( - function() + --MyPCall( + --function() + --self:InitComponent() + --end + --) self:BindEvent() - end - ) + --MyPCall( + --function() + --self:BindEvent() + --end + --) end --设置渲染层级 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua index 4dcf24d623..bfe1e12011 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua @@ -96,7 +96,7 @@ function this:InitComponent() this.battleSceneLogicGameObject, this.battleSceneGameObject = BattleManager.CreateBattleScene(nil) chatPanel:InitComponent(Util.GetGameObject(self.gameObject, "ChatPanel"), this) BattleView:InitComponent(self, this.battleSceneLogicGameObject, this.battleSceneGameObject) - + LogError("gggggggggggggggggggggggggggggg") this.spLoader = SpriteLoader.New() --BattleView:InitComponent(self, self.gameObject) @@ -1046,7 +1046,7 @@ end function this:OnDestroy() LogError("dddddddddddddddddddddddddddddd") BattleView:OnDestroy() - --chatPanel:OnDestroy() + chatPanel:OnDestroy() this.spLoader:Destroy() --销毁战场 if this.battleSceneLogicGameObject ~= nil then diff --git a/Assets/ManagedResources/~Lua/Modules/Chat/BattleChatPanel.lua b/Assets/ManagedResources/~Lua/Modules/Chat/BattleChatPanel.lua index 467a00f7d5..2519189002 100644 --- a/Assets/ManagedResources/~Lua/Modules/Chat/BattleChatPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Chat/BattleChatPanel.lua @@ -69,9 +69,9 @@ end function this:BindEvent() -- 关闭界面 - Util.AddClick(this.btnBack, function() - UIManager.OpenPanel(UIName.ChatPanel, nil, 2) - end) + --Util.AddClick(this.btnBack, function() + --UIManager.OpenPanel(UIName.ChatPanel, nil, 2) + --end) -- 发送消息 Util.AddClick(this.btnSend, function() @@ -157,6 +157,18 @@ end function this:OnClose() -- 关闭定时刷新数据 ChatManager.StopChatDataUpdate() + if this.FriendScrollView then + SubUIManager.Close(this.FriendScrollView) + this.FriendScrollView = nil + end + if this.ChatScrollView then + SubUIManager.Close(this.ChatScrollView) + this.ChatScrollView = nil + end + if this.SystemScrollView then + SubUIManager.Close(this.SystemScrollView) + this.SystemScrollView = nil + end end -- tab节点自定义设置