123456789101112131415 |
- namespace XGame.Framework.Data
- {
- /// <summary>
- /// IData 的单例基类
- /// </summary>
- /// <typeparam name="TType"></typeparam>
- public abstract class DataSingleton<TType> : IData where TType : DataSingleton<TType>, new()
- {
- public static TType Instance => DataModule.Instance.GetOrAdd<TType>();
- public static void Dispose()
- {
- DataModule.Instance.Remove<TType>();
- }
- }
- }
|