mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2026-04-21 17:35:56 +08:00
update meta
This commit is contained in:
parent
d52c3031f2
commit
87c98f708e
@ -59,7 +59,6 @@ namespace DCFApixels.DragonECS.Core.Internal
|
|||||||
#endif
|
#endif
|
||||||
[MetaColor(MetaColor.DragonRose)]
|
[MetaColor(MetaColor.DragonRose)]
|
||||||
[MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)]
|
[MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)]
|
||||||
[MetaDescription(EcsConsts.AUTHOR, "...")]
|
|
||||||
[MetaTags(MetaTags.HIDDEN)]
|
[MetaTags(MetaTags.HIDDEN)]
|
||||||
[MetaID("DragonECS_3273527C9201285BAA0A463F700A50FB")]
|
[MetaID("DragonECS_3273527C9201285BAA0A463F700A50FB")]
|
||||||
internal sealed class EcsPreInitRunner : EcsRunner<IEcsPreInit>, IEcsPreInit
|
internal sealed class EcsPreInitRunner : EcsRunner<IEcsPreInit>, IEcsPreInit
|
||||||
@ -80,7 +79,6 @@ namespace DCFApixels.DragonECS.Core.Internal
|
|||||||
#endif
|
#endif
|
||||||
[MetaColor(MetaColor.DragonRose)]
|
[MetaColor(MetaColor.DragonRose)]
|
||||||
[MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)]
|
[MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)]
|
||||||
[MetaDescription(EcsConsts.AUTHOR, "...")]
|
|
||||||
[MetaTags(MetaTags.HIDDEN)]
|
[MetaTags(MetaTags.HIDDEN)]
|
||||||
[MetaID("DragonECS_ED85527C9201A391AB8EC0B734917859")]
|
[MetaID("DragonECS_ED85527C9201A391AB8EC0B734917859")]
|
||||||
internal sealed class EcsInitRunner : EcsRunner<IEcsInit>, IEcsInit
|
internal sealed class EcsInitRunner : EcsRunner<IEcsInit>, IEcsInit
|
||||||
@ -101,7 +99,6 @@ namespace DCFApixels.DragonECS.Core.Internal
|
|||||||
#endif
|
#endif
|
||||||
[MetaColor(MetaColor.DragonRose)]
|
[MetaColor(MetaColor.DragonRose)]
|
||||||
[MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)]
|
[MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)]
|
||||||
[MetaDescription(EcsConsts.AUTHOR, "...")]
|
|
||||||
[MetaTags(MetaTags.HIDDEN)]
|
[MetaTags(MetaTags.HIDDEN)]
|
||||||
[MetaID("DragonECS_2098527C9201F260C840BFD50BC7E0BA")]
|
[MetaID("DragonECS_2098527C9201F260C840BFD50BC7E0BA")]
|
||||||
internal sealed class EcsRunRunner : EcsRunner<IEcsRun>, IEcsRun
|
internal sealed class EcsRunRunner : EcsRunner<IEcsRun>, IEcsRun
|
||||||
@ -182,7 +179,6 @@ namespace DCFApixels.DragonECS.Core.Internal
|
|||||||
#endif
|
#endif
|
||||||
[MetaColor(MetaColor.DragonRose)]
|
[MetaColor(MetaColor.DragonRose)]
|
||||||
[MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)]
|
[MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)]
|
||||||
[MetaDescription(EcsConsts.AUTHOR, "...")]
|
|
||||||
[MetaTags(MetaTags.HIDDEN)]
|
[MetaTags(MetaTags.HIDDEN)]
|
||||||
[MetaID("DragonECS_06A6527C92010430ACEB3DA520F272CC")]
|
[MetaID("DragonECS_06A6527C92010430ACEB3DA520F272CC")]
|
||||||
internal sealed class EcsDestroyRunner : EcsRunner<IEcsDestroy>, IEcsDestroy
|
internal sealed class EcsDestroyRunner : EcsRunner<IEcsDestroy>, IEcsDestroy
|
||||||
|
|||||||
@ -73,6 +73,10 @@ namespace DCFApixels.DragonECS
|
|||||||
}
|
}
|
||||||
return new MetaGroup(name);
|
return new MetaGroup(name);
|
||||||
}
|
}
|
||||||
|
public static MetaGroup FromName(params string[] path)
|
||||||
|
{
|
||||||
|
return FromName(string.Join(SEPARATOR, path));
|
||||||
|
}
|
||||||
public static MetaGroup FromNameSpace(Type type)
|
public static MetaGroup FromNameSpace(Type type)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(type.Namespace))
|
if (string.IsNullOrWhiteSpace(type.Namespace))
|
||||||
|
|||||||
@ -11,23 +11,21 @@ namespace DCFApixels.DragonECS
|
|||||||
public sealed class MetaProxyAttribute : DragonMetaAttribute
|
public sealed class MetaProxyAttribute : DragonMetaAttribute
|
||||||
{
|
{
|
||||||
public Type Type;
|
public Type Type;
|
||||||
public MetaProxyAttribute(Type type)
|
public bool ForDeclaringType;
|
||||||
|
public MetaProxyAttribute(Type type, bool forDeclaringType = false)
|
||||||
{
|
{
|
||||||
Type = type;
|
Type = type;
|
||||||
|
ForDeclaringType = forDeclaringType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class MetaProxyBase
|
public class MetaProxyBase
|
||||||
{
|
{
|
||||||
public static readonly MetaProxyBase EmptyProxy = new MetaProxyBase(typeof(void));
|
public static readonly MetaProxyBase EmptyProxy = new MetaProxyBase(typeof(void));
|
||||||
public readonly Type Type;
|
|
||||||
public virtual string Name { get { return null; } }
|
public virtual string Name { get { return null; } }
|
||||||
public virtual MetaColor? Color { get { return null; } }
|
public virtual MetaColor? Color { get { return null; } }
|
||||||
public virtual MetaDescription Description { get { return null; } }
|
public virtual MetaDescription Description { get { return null; } }
|
||||||
public virtual MetaGroup Group { get { return null; } }
|
public virtual MetaGroup Group { get { return null; } }
|
||||||
public virtual IEnumerable<string> Tags { get { return null; } }
|
public virtual IEnumerable<string> Tags { get { return null; } }
|
||||||
public MetaProxyBase(Type type)
|
public MetaProxyBase(Type type) { }
|
||||||
{
|
|
||||||
Type = type;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -125,27 +125,25 @@ namespace DCFApixels.DragonECS
|
|||||||
_type = type;
|
_type = type;
|
||||||
_proxy = MetaProxyBase.EmptyProxy;
|
_proxy = MetaProxyBase.EmptyProxy;
|
||||||
|
|
||||||
if (type.ContainsGenericParameters == false &&
|
if (type.TryGetAttributeInherited<MetaProxyAttribute>(out var proxyAtr, out var declaringAtrType))
|
||||||
type.TryGetAttributeInherited<MetaProxyAttribute>(out var proxyAtr, out var declareAtrType))
|
|
||||||
{
|
{
|
||||||
Type proxyType = proxyAtr.Type;
|
Type proxyType = proxyAtr.Type;
|
||||||
if (proxyType.ContainsGenericParameters && proxyType.IsNested)
|
if (proxyType.ContainsGenericParameters && proxyType.IsNested)
|
||||||
{
|
{
|
||||||
var baseType = FindDeclaringType(proxyType.DeclaringType, type);
|
if (declaringAtrType != null && declaringAtrType.ContainsGenericParameters == false)
|
||||||
if(baseType != null)
|
|
||||||
{
|
{
|
||||||
var args = baseType.GetGenericArguments();
|
var args = declaringAtrType.GetGenericArguments();
|
||||||
proxyType = proxyType.MakeGenericType(args);
|
proxyType = proxyType.MakeGenericType(args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (proxyType.ContainsGenericParameters == false)
|
if (proxyType.ContainsGenericParameters == false)
|
||||||
{
|
{
|
||||||
var proxy = Activator.CreateInstance(proxyType, type) as MetaProxyBase;
|
var proxy = Activator.CreateInstance(proxyType, proxyAtr.ForDeclaringType ? declaringAtrType : type) as MetaProxyBase;
|
||||||
if (proxy != null)
|
if (proxy != null)
|
||||||
{
|
{
|
||||||
_proxy = proxy;
|
_proxy = proxy;
|
||||||
_isSelfProxy = declareAtrType == type;
|
_isSelfProxy = declaringAtrType == type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,6 +63,23 @@ namespace DCFApixels.DragonECS
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public delegate void ActionWithData<in TProcess, T>(TProcess process, ref T Data);
|
public delegate void ActionWithData<in TProcess, T>(TProcess process, ref T Data);
|
||||||
|
|
||||||
|
#region MetaProxy
|
||||||
|
protected class RunnerMetaProxy : MetaProxyBase
|
||||||
|
{
|
||||||
|
private TypeMeta _processMeta;
|
||||||
|
public override MetaColor? Color => MetaColor.DragonRose;
|
||||||
|
public override MetaDescription Description => new MetaDescription(EcsConsts.AUTHOR, $"Runner for {_processMeta.TypeName} process.");
|
||||||
|
public override MetaGroup Group => MetaGroup.FromName(EcsConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP);
|
||||||
|
public RunnerMetaProxy(Type type) : base(type)
|
||||||
|
{
|
||||||
|
if (type.IsGenericType)
|
||||||
|
{
|
||||||
|
_processMeta = type.GetGenericArguments()[0].GetMeta();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
[MetaColor(MetaColor.DragonRose)]
|
[MetaColor(MetaColor.DragonRose)]
|
||||||
@ -80,9 +97,9 @@ namespace DCFApixels.DragonECS
|
|||||||
|
|
||||||
[MetaColor(MetaColor.DragonRose)]
|
[MetaColor(MetaColor.DragonRose)]
|
||||||
[MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.OTHER_GROUP)]
|
[MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.OTHER_GROUP)]
|
||||||
[MetaDescription(EcsConsts.AUTHOR, "...")]
|
|
||||||
[MetaTags(MetaTags.HIDDEN)]
|
[MetaTags(MetaTags.HIDDEN)]
|
||||||
[MetaID("DragonECS_7DB3557C9201F85E0E1C17D7B19D9CEE")]
|
[MetaID("DragonECS_7DB3557C9201F85E0E1C17D7B19D9CEE")]
|
||||||
|
[MetaProxy(typeof(RunnerMetaProxy), true)]
|
||||||
public abstract class EcsRunner<TProcess> : EcsRunner, IEcsRunner, IEcsProcess
|
public abstract class EcsRunner<TProcess> : EcsRunner, IEcsRunner, IEcsProcess
|
||||||
where TProcess : IEcsProcess
|
where TProcess : IEcsProcess
|
||||||
{
|
{
|
||||||
@ -476,8 +493,6 @@ namespace DCFApixels.DragonECS
|
|||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//----
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -294,6 +294,8 @@ namespace DCFApixels.DragonECS
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region NullWorld
|
#region NullWorld
|
||||||
|
[MetaTags(MetaTags.HIDDEN)]
|
||||||
|
[MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.OTHER_GROUP)]
|
||||||
private sealed class NullWorld : EcsWorld
|
private sealed class NullWorld : EcsWorld
|
||||||
{
|
{
|
||||||
internal NullWorld() : base(new EcsWorldConfig(4, 4, 4, 4, 4), null, 0) { }
|
internal NullWorld() : base(new EcsWorldConfig(4, 4, 4, 4, 4), null, 0) { }
|
||||||
|
|||||||
@ -19,21 +19,21 @@ namespace DCFApixels.DragonECS.Core.Internal
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static bool TryGetAttributeInherited<T>(this Type self, out T attribute, out Type declareAtrType) where T : Attribute
|
public static bool TryGetAttributeInherited<T>(this Type self, out T attribute, out Type declaringAtrType) where T : Attribute
|
||||||
{
|
{
|
||||||
if (self == null || self == typeof(object))
|
if (self == null || self == typeof(object))
|
||||||
{
|
{
|
||||||
attribute = null;
|
attribute = null;
|
||||||
declareAtrType = null;
|
declaringAtrType = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute = self.GetCustomAttribute<T>();
|
attribute = self.GetCustomAttribute<T>();
|
||||||
if (attribute == null)
|
if (attribute == null)
|
||||||
{
|
{
|
||||||
return self.BaseType.TryGetAttributeInherited<T>(out attribute, out declareAtrType);
|
return self.BaseType.TryGetAttributeInherited<T>(out attribute, out declaringAtrType);
|
||||||
}
|
}
|
||||||
declareAtrType = self;
|
declaringAtrType = self;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
|||||||
@ -400,6 +400,9 @@ namespace DCFApixels.DragonECS
|
|||||||
#if ENABLE_IL2CPP
|
#if ENABLE_IL2CPP
|
||||||
[Il2CppSetOption(Option.NullChecks, false)]
|
[Il2CppSetOption(Option.NullChecks, false)]
|
||||||
#endif
|
#endif
|
||||||
|
[MetaTags(MetaTags.HIDDEN)]
|
||||||
|
[MetaColor(MetaColor.DragonRose)]
|
||||||
|
[MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.OTHER_GROUP)]
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
public readonly struct ReadonlyEcsPool<T> : IEcsReadonlyPool //IEnumerable<T> - IntelliSense hack
|
public readonly struct ReadonlyEcsPool<T> : IEcsReadonlyPool //IEnumerable<T> - IntelliSense hack
|
||||||
where T : struct, IEcsComponent
|
where T : struct, IEcsComponent
|
||||||
|
|||||||
@ -343,6 +343,9 @@ namespace DCFApixels.DragonECS
|
|||||||
#if ENABLE_IL2CPP
|
#if ENABLE_IL2CPP
|
||||||
[Il2CppSetOption(Option.NullChecks, false)]
|
[Il2CppSetOption(Option.NullChecks, false)]
|
||||||
#endif
|
#endif
|
||||||
|
[MetaTags(MetaTags.HIDDEN)]
|
||||||
|
[MetaColor(MetaColor.DragonRose)]
|
||||||
|
[MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.OTHER_GROUP)]
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
public readonly struct ReadonlyEcsTagPool<T> : IEcsReadonlyPool //IEnumerable<T> - IntelliSense hack
|
public readonly struct ReadonlyEcsTagPool<T> : IEcsReadonlyPool //IEnumerable<T> - IntelliSense hack
|
||||||
where T : struct, IEcsTagComponent
|
where T : struct, IEcsTagComponent
|
||||||
|
|||||||
@ -408,6 +408,9 @@ namespace DCFApixels.DragonECS
|
|||||||
#if ENABLE_IL2CPP
|
#if ENABLE_IL2CPP
|
||||||
[Il2CppSetOption(Option.NullChecks, false)]
|
[Il2CppSetOption(Option.NullChecks, false)]
|
||||||
#endif
|
#endif
|
||||||
|
[MetaTags(MetaTags.HIDDEN)]
|
||||||
|
[MetaColor(MetaColor.DragonRose)]
|
||||||
|
[MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.OTHER_GROUP)]
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
public readonly struct ReadonlyEcsValuePool<T> : IEcsReadonlyPool //IEnumerable<T> - IntelliSense hack
|
public readonly struct ReadonlyEcsValuePool<T> : IEcsReadonlyPool //IEnumerable<T> - IntelliSense hack
|
||||||
where T : unmanaged, IEcsValueComponent
|
where T : unmanaged, IEcsValueComponent
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user