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()