From b80a700380878668f777d7517697f109a11c5091 Mon Sep 17 00:00:00 2001 From: fatiao <515948292@qq.com> Date: Thu, 12 Feb 2026 16:57:23 +0800 Subject: [PATCH] =?UTF-8?q?UIChat=E9=83=A8=E5=88=86=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=BA=A2=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Content/Prefabs/UI/UIChat/UIChat.prefab | 37 ++----------------- .../Content/Prefabs/UI/UIMain/UIMain.prefab | 2 +- .../ChatSearchTabItem_Generate.lua | 17 +++++++++ Assets/Lua/UI/UIChat/UIChatView.lua | 1 + Assets/Lua/Util/CommonUtil.lua | 7 ++++ 5 files changed, 29 insertions(+), 35 deletions(-) diff --git a/Assets/Content/Prefabs/UI/UIChat/UIChat.prefab b/Assets/Content/Prefabs/UI/UIChat/UIChat.prefab index 399620c7a..6987fb51d 100644 --- a/Assets/Content/Prefabs/UI/UIChat/UIChat.prefab +++ b/Assets/Content/Prefabs/UI/UIChat/UIChat.prefab @@ -20202,7 +20202,7 @@ MonoBehaviour: m_Top: 0 m_Bottom: 0 m_ChildAlignment: 1 - m_Spacing: 2 + m_Spacing: 20 m_ChildForceExpandWidth: 0 m_ChildForceExpandHeight: 0 m_ChildControlWidth: 1 @@ -23778,7 +23778,6 @@ GameObject: m_Component: - component: {fileID: 6597347289572171726} - component: {fileID: 4973907414672328632} - - component: {fileID: 9078399487502680034} - component: {fileID: 8550598987683907859} m_Layer: 5 m_Name: RedPoint @@ -23786,7 +23785,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &6597347289572171726 RectTransform: m_ObjectHideFlags: 0 @@ -23803,7 +23802,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -10, y: -10} + m_AnchoredPosition: {x: -33.7, y: -26.2} m_SizeDelta: {x: 56, y: 56} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &4973907414672328632 @@ -23814,36 +23813,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8853271749901229638} m_CullTransparentMesh: 0 ---- !u!114 &9078399487502680034 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8853271749901229638} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 01fc6dfb7806e454595b5a754d4cff73, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 --- !u!114 &8550598987683907859 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Content/Prefabs/UI/UIMain/UIMain.prefab b/Assets/Content/Prefabs/UI/UIMain/UIMain.prefab index fc413e710..55fffd733 100644 --- a/Assets/Content/Prefabs/UI/UIMain/UIMain.prefab +++ b/Assets/Content/Prefabs/UI/UIMain/UIMain.prefab @@ -3397,8 +3397,8 @@ RectTransform: m_Children: - {fileID: 5695566469530501736} - {fileID: 8686483031141590590} - - {fileID: 2754360920761901112} - {fileID: 2765585946249365751} + - {fileID: 2754360920761901112} - {fileID: 602150543970277784} - {fileID: 4277932189784085218} - {fileID: 8123859824791095904} diff --git a/Assets/Lua/UI/GridViewItem/ChatSearchTabItem_Generate.lua b/Assets/Lua/UI/GridViewItem/ChatSearchTabItem_Generate.lua index 426c31b0b..7052d0431 100644 --- a/Assets/Lua/UI/GridViewItem/ChatSearchTabItem_Generate.lua +++ b/Assets/Lua/UI/GridViewItem/ChatSearchTabItem_Generate.lua @@ -2,6 +2,7 @@ ---@field public gameObject UnityEngine.GameObject ---@field public button UnityEngine.UI.Button ---@field public lock UnityEngine.GameObject +---@field public redPoint UnityEngine.GameObject ---@class ChatSearchTabItem__Generate_commentNum ---@field public gameObject UnityEngine.GameObject @@ -131,6 +132,7 @@ function ChatSearchTabItemView:InitGenerate(Root, data) self:InitGenerate__22(Root,data) self:InitGenerate__23(Root,data) self:InitGenerate__24(Root,data) + self:InitGenerate__25(Root,data) end @@ -450,8 +452,23 @@ function ChatSearchTabItemView:InitGenerate__24(Root, data) self.greetBtn.lock = tmp end +---@private +function ChatSearchTabItemView:InitGenerate__25(Root, data) +--[[ + Right/BottomPart/GreetBtn/RedPoint +--]] + local tmp = Root:Find("Right/BottomPart/GreetBtn/RedPoint").gameObject + if tolua.getpeer(tmp) == nil then + tolua.setpeer(tmp, {}) + end + self.greetBtn.redPoint = tmp +end + ---@private function ChatSearchTabItemView:GenerateDestroy() + if tolua.getpeer(self.greetBtn.redPoint) ~= nil then + tolua.setpeer(self.greetBtn.redPoint, nil) + end if tolua.getpeer(self.greetBtn.lock) ~= nil then tolua.setpeer(self.greetBtn.lock, nil) end diff --git a/Assets/Lua/UI/UIChat/UIChatView.lua b/Assets/Lua/UI/UIChat/UIChatView.lua index e6186ffcf..fbbac5a9a 100644 --- a/Assets/Lua/UI/UIChat/UIChatView.lua +++ b/Assets/Lua/UI/UIChat/UIChatView.lua @@ -989,6 +989,7 @@ function UIChatView:SetSearchTabItem(itemLua, idx, itemData) itemLua.greetBtn.lock:SetActive(isUnlock==false) itemLua.greetBtn.button.interactable = isUnlock if isUnlock then + CommonUtil.CreateNormalRedPoint(itemLua.greetBtn.redPoint, function(rp)end) self.uiBase:AddButtonUniqueEventListener(itemLua.greetBtn.button, self, function() self:OnGreetBtn(itemData) end) end end diff --git a/Assets/Lua/Util/CommonUtil.lua b/Assets/Lua/Util/CommonUtil.lua index 5bebf91e0..bab4c658b 100644 --- a/Assets/Lua/Util/CommonUtil.lua +++ b/Assets/Lua/Util/CommonUtil.lua @@ -3157,3 +3157,10 @@ function CreateNewRedPoint(parent, cb) end end) end + +function RemoveRedPoint(parent) + for i = _target.transform.childCount-1, 0, -1 do + local _child = _target.transform:GetChild(i) + DestroyGO(_child.gameObject) + end +end