【m】修改dispose方法
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Stary.Evo
|
|||||||
/// 架构
|
/// 架构
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="T"></typeparam>
|
/// <typeparam name="T"></typeparam>
|
||||||
public abstract class Architecture<T> : IArchitecture where T : Architecture<T>, new()
|
public abstract class Architecture<T> : IDisposable, IArchitecture where T : Architecture<T>, new()
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否已经初始化完成
|
/// 是否已经初始化完成
|
||||||
@@ -91,7 +91,7 @@ namespace Stary.Evo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// // 提供一个释放模块的 API
|
// // 提供一个释放模块的 API
|
||||||
public void Dispose()
|
public void OnDispose()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < mArchitecture.mSystems.Count; i++)
|
for (int i = 0; i < mArchitecture.mSystems.Count; i++)
|
||||||
{
|
{
|
||||||
@@ -102,6 +102,7 @@ namespace Stary.Evo
|
|||||||
{
|
{
|
||||||
mArchitecture.mDatas[i].Dispose();
|
mArchitecture.mDatas[i].Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
_mEnumEventSystem.Dispose();
|
_mEnumEventSystem.Dispose();
|
||||||
_mEnumEventSystem = null;
|
_mEnumEventSystem = null;
|
||||||
mArchitecture = null;
|
mArchitecture = null;
|
||||||
@@ -340,6 +341,7 @@ namespace Stary.Evo
|
|||||||
{
|
{
|
||||||
_mEnumEventSystem.UnRegister(key, onEvent);
|
_mEnumEventSystem.UnRegister(key, onEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 事件销毁
|
/// 事件销毁
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -349,24 +351,29 @@ namespace Stary.Evo
|
|||||||
{
|
{
|
||||||
_mEnumEventSystem.UnRegister(key, onEvent);
|
_mEnumEventSystem.UnRegister(key, onEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 事件销毁
|
/// 事件销毁
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="onEvent"></param>
|
/// <param name="onEvent"></param>
|
||||||
/// <typeparam name="T"></typeparam>
|
/// <typeparam name="T"></typeparam>
|
||||||
public void UnRegisterEvent<TEvent, Tvalue1, Tvalue2>(TEvent key, Action<Tvalue1, Tvalue2> onEvent)where TEvent : IConvertible
|
public void UnRegisterEvent<TEvent, Tvalue1, Tvalue2>(TEvent key, Action<Tvalue1, Tvalue2> onEvent)
|
||||||
|
where TEvent : IConvertible
|
||||||
{
|
{
|
||||||
_mEnumEventSystem.UnRegister(key, onEvent);
|
_mEnumEventSystem.UnRegister(key, onEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 事件销毁
|
/// 事件销毁
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="onEvent"></param>
|
/// <param name="onEvent"></param>
|
||||||
/// <typeparam name="T"></typeparam>
|
/// <typeparam name="T"></typeparam>
|
||||||
public void UnRegisterEvent<TEvent, Tvlue1, Tvlue2, Tvlue3>(TEvent key, Action<Tvlue1, Tvlue2, Tvlue3> onEvent)where TEvent : IConvertible
|
public void UnRegisterEvent<TEvent, Tvlue1, Tvlue2, Tvlue3>(TEvent key, Action<Tvlue1, Tvlue2, Tvlue3> onEvent)
|
||||||
|
where TEvent : IConvertible
|
||||||
{
|
{
|
||||||
_mEnumEventSystem.UnRegister(key, onEvent);
|
_mEnumEventSystem.UnRegister(key, onEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 事件销毁
|
/// 事件销毁
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -376,6 +383,7 @@ namespace Stary.Evo
|
|||||||
{
|
{
|
||||||
_mEnumEventSystem.UnRegister(key, onEvent);
|
_mEnumEventSystem.UnRegister(key, onEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TResult SendQuery<TResult>(IQuery<TResult> query)
|
public TResult SendQuery<TResult>(IQuery<TResult> query)
|
||||||
{
|
{
|
||||||
return DoQuery<TResult>(query);
|
return DoQuery<TResult>(query);
|
||||||
@@ -386,5 +394,10 @@ namespace Stary.Evo
|
|||||||
query.SetArchitecture(this);
|
query.SetArchitecture(this);
|
||||||
return query.Do();
|
return query.Do();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
OnDispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -170,6 +170,6 @@ namespace Stary.Evo
|
|||||||
|
|
||||||
TResult SendQuery<TResult>(IQuery<TResult> query);
|
TResult SendQuery<TResult>(IQuery<TResult> query);
|
||||||
|
|
||||||
void Dispose();
|
void OnDispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "com.staryevo.main",
|
"name": "com.staryevo.main",
|
||||||
"version": "1.3.27",
|
"version": "1.3.28",
|
||||||
"displayName": "00.StaryEvo",
|
"displayName": "00.StaryEvo",
|
||||||
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
||||||
"unity": "2021.3",
|
"unity": "2021.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user