From 72895a3b4dc82cb8876d900c2d3e15af8d7e742f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E9=93=AE?= <834207172@qq.com>
Date: Thu, 31 Jul 2025 17:36:17 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90m=E3=80=91=E4=BF=AE=E6=94=B9dispose?=
=?UTF-8?q?=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Runtime/Architecture/Architecture.cs | 39 ++++++++++++-------
.../Runtime/Architecture/IArchitecture.cs | 2 +-
Assets/00.StaryEvo/package.json | 2 +-
3 files changed, 28 insertions(+), 15 deletions(-)
diff --git a/Assets/00.StaryEvo/Runtime/Architecture/Architecture.cs b/Assets/00.StaryEvo/Runtime/Architecture/Architecture.cs
index 0cf761d..a69c7dd 100644
--- a/Assets/00.StaryEvo/Runtime/Architecture/Architecture.cs
+++ b/Assets/00.StaryEvo/Runtime/Architecture/Architecture.cs
@@ -9,7 +9,7 @@ namespace Stary.Evo
/// 架构
///
///
- public abstract class Architecture : IArchitecture where T : Architecture, new()
+ public abstract class Architecture : IDisposable, IArchitecture where T : Architecture, new()
{
///
/// 是否已经初始化完成
@@ -91,7 +91,7 @@ namespace Stary.Evo
}
// // 提供一个释放模块的 API
- public void Dispose()
+ public void OnDispose()
{
for (int i = 0; i < mArchitecture.mSystems.Count; i++)
{
@@ -102,8 +102,9 @@ namespace Stary.Evo
{
mArchitecture.mDatas[i].Dispose();
}
+
_mEnumEventSystem.Dispose();
- _mEnumEventSystem=null;
+ _mEnumEventSystem = null;
mArchitecture = null;
}
@@ -336,46 +337,53 @@ namespace Stary.Evo
///
///
///
- public void UnRegisterEvent(TEvent key, Action onEvent)where TEvent : IConvertible
+ public void UnRegisterEvent(TEvent key, Action onEvent) where TEvent : IConvertible
{
- _mEnumEventSystem.UnRegister(key,onEvent);
+ _mEnumEventSystem.UnRegister(key, onEvent);
}
+
///
/// 事件销毁
///
///
///
- public void UnRegisterEvent(TEvent key, Action< Tvalue1> onEvent)where TEvent : IConvertible
+ public void UnRegisterEvent(TEvent key, Action onEvent) where TEvent : IConvertible
{
- _mEnumEventSystem.UnRegister(key,onEvent);
+ _mEnumEventSystem.UnRegister(key, onEvent);
}
+
///
/// 事件销毁
///
///
///
- public void UnRegisterEvent(TEvent key, Action onEvent)where TEvent : IConvertible
+ public void UnRegisterEvent(TEvent key, Action onEvent)
+ where TEvent : IConvertible
{
- _mEnumEventSystem.UnRegister(key,onEvent);
+ _mEnumEventSystem.UnRegister(key, onEvent);
}
+
///
/// 事件销毁
///
///
///
- public void UnRegisterEvent(TEvent key, Action onEvent)where TEvent : IConvertible
+ public void UnRegisterEvent(TEvent key, Action onEvent)
+ where TEvent : IConvertible
{
- _mEnumEventSystem.UnRegister(key,onEvent);
+ _mEnumEventSystem.UnRegister(key, onEvent);
}
+
///
/// 事件销毁
///
///
///
- public void UnRegisterEvent(TEvent key, Action