2025-03-14 16:53:33 +08:00
|
|
|
|
#if DISABLE_DEBUG
|
|
|
|
|
#undef DEBUG
|
|
|
|
|
#endif
|
|
|
|
|
using System;
|
2023-06-16 16:13:44 +08:00
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
|
|
namespace DCFApixels.DragonECS
|
|
|
|
|
{
|
|
|
|
|
#if UNITY_2020_3_OR_NEWER
|
|
|
|
|
[UnityEngine.Scripting.Preserve]
|
|
|
|
|
#endif
|
|
|
|
|
internal static class DummyInstance<T>
|
|
|
|
|
{
|
|
|
|
|
#if UNITY_2020_3_OR_NEWER
|
|
|
|
|
[UnityEngine.Scripting.Preserve]
|
|
|
|
|
#endif
|
|
|
|
|
public static T intsance = (T)Activator.CreateInstance(typeof(T));
|
|
|
|
|
}
|
|
|
|
|
internal static class DummyInstance
|
|
|
|
|
{
|
|
|
|
|
private static Type _dummyInstance = typeof(DummyInstance<>);
|
|
|
|
|
public static object GetInstance(Type type)
|
|
|
|
|
{
|
|
|
|
|
return _dummyInstance.MakeGenericType(type).GetField("intsance", BindingFlags.Static | BindingFlags.Public).GetValue(null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|