From 714f180c9e8f1c354ebb2029d5bd9f24da15ef55 Mon Sep 17 00:00:00 2001 From: "DESKTOP-SAJ6RKV\\Administrator" Date: Fri, 16 May 2025 18:46:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E6=B5=81=E7=A8=8B=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HotFix/GameLogic/Actor/ActorHItem.cs | 15 ++++++++++++++- .../GameLogic/Manager/DataGameSceneManager.cs | 1 + .../HotFix/GameLogic/UI/UIGameRankForm.cs | 8 +++----- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Actor/ActorHItem.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Actor/ActorHItem.cs index 88b25303..c12d6df4 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Actor/ActorHItem.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Actor/ActorHItem.cs @@ -42,12 +42,20 @@ namespace GameLogic private Dictionary> m_Buffs = new Dictionary>(); //自身Buff列表 + private int timerId = -1; + protected override void OnCreate() { base.OnCreate(); - GameModule.Timer.AddTimer(TimerHandler, 0.01f, true); + timerId = GameModule.Timer.AddTimer(TimerHandler, 0.01f, true); + } + + protected override void OnDestroy() + { + base.OnDestroy(); + GameModule.Timer.RemoveTimer(timerId); } private void TimerHandler(object[] e) @@ -389,6 +397,11 @@ namespace GameLogic private void LoadTextureMatRes(int key) { + if (this.gameObject == null) + { + return; + } + // 先隐藏其他 for (int i = 1; i < m_rectCar.childCount; i++) { diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameSceneManager.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameSceneManager.cs index 063c5829..67757be7 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameSceneManager.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameSceneManager.cs @@ -908,6 +908,7 @@ namespace GameLogic m_TeamSortList.Clear(); + m_DicTeamList.Clear(); diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/UI/UIGameRankForm.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/UI/UIGameRankForm.cs index 2fe288de..34634295 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/UI/UIGameRankForm.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/UI/UIGameRankForm.cs @@ -70,16 +70,14 @@ namespace GameLogic m_loopListView_View.RefreshAllShownItem(); } - protected override void Close() + + protected override void OnDestroy() { - base.Close(); - - + base.OnDestroy(); Log.Debug("UIGameRankForm Close"); DataGameSceneManager.Instance.OnRestData(); } - LoopListViewItem OnGetItemByIndex(LoopListView listView, int index) { if (index >= m_PlayRankDatas.Count)