From e3c9ac625c1d9f72ab9ee39c50638e11c0075def Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Thu, 7 Nov 2024 19:23:59 +0800 Subject: [PATCH] =?UTF-8?q?Room=E5=88=97=E8=A1=A8=E8=BF=AD=E4=BB=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs | 5 +++++ AxibugEmuOnline.Client/Assets/Script/UI/RoomListMenuItem.cs | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs index 90742380..cf644df8 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs @@ -37,6 +37,11 @@ namespace AxibugEmuOnline.Client.UI Reset(); } + protected virtual void OnDestroy() + { + + } + public void SetData(MenuData data) { Reset(); diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/RoomListMenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/UI/RoomListMenuItem.cs index ee565884..98ed0352 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/RoomListMenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/RoomListMenuItem.cs @@ -11,6 +11,12 @@ namespace AxibugEmuOnline.Client protected override void Awake() { Eventer.Instance.RegisterEvent(EEvent.OnRoomListAllUpdate, OnRoomListUpdateAll); + base.Awake(); + } + + protected override void OnDestroy() + { + Eventer.Instance.UnregisterEvent(EEvent.OnRoomListAllUpdate, OnRoomListUpdateAll); } public override bool OnEnterItem()