mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-17 17:34:36 +08:00
update debug
This commit is contained in:
parent
8b0cd12403
commit
6fcad52300
@ -384,6 +384,10 @@ namespace DCFApixels.DragonECS
|
||||
#endregion
|
||||
|
||||
#region GetCachedTypeMeta
|
||||
public static TypeMetaDataCached GetMeta(this object self)
|
||||
{
|
||||
return GetCachedTypeMeta(self);
|
||||
}
|
||||
private static readonly Dictionary<Type, TypeMetaDataCached> _metaCache = new Dictionary<Type, TypeMetaDataCached>();
|
||||
public static TypeMetaDataCached GetCachedTypeMeta(object obj)
|
||||
{
|
||||
|
6
src/Debug/MetaAttributes/EcsMetaAttribute.cs
Normal file
6
src/Debug/MetaAttributes/EcsMetaAttribute.cs
Normal file
@ -0,0 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace DCFApixels.DragonECS
|
||||
{
|
||||
public abstract class EcsMetaAttribute : Attribute { }
|
||||
}
|
@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
|
||||
namespace DCFApixels.DragonECS
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class | AttributeTargets.Interface, Inherited = false, AllowMultiple = false)]
|
||||
public sealed class MetaColorAttribute : Attribute
|
||||
public sealed class MetaColorAttribute : EcsMetaAttribute
|
||||
{
|
||||
public readonly MetaColor color;
|
||||
public byte R => color.r;
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace DCFApixels.DragonECS
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class | AttributeTargets.Interface, Inherited = false, AllowMultiple = false)]
|
||||
public sealed class MetaDescriptionAttribute : Attribute
|
||||
public sealed class MetaDescriptionAttribute : EcsMetaAttribute
|
||||
{
|
||||
public readonly string description;
|
||||
public MetaDescriptionAttribute(string description) => this.description = description;
|
||||
|
@ -4,7 +4,7 @@ using System.Text.RegularExpressions;
|
||||
namespace DCFApixels.DragonECS
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class | AttributeTargets.Interface, Inherited = false, AllowMultiple = false)]
|
||||
public sealed class MetaGroupAttribute : Attribute
|
||||
public sealed class MetaGroupAttribute : EcsMetaAttribute
|
||||
{
|
||||
public static readonly MetaGroupAttribute Empty = new MetaGroupAttribute("");
|
||||
public readonly string name;
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace DCFApixels.DragonECS
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class | AttributeTargets.Interface, Inherited = false, AllowMultiple = false)]
|
||||
public sealed class MetaNameAttribute : Attribute
|
||||
public sealed class MetaNameAttribute : EcsMetaAttribute
|
||||
{
|
||||
public readonly string name;
|
||||
public MetaNameAttribute(string name) => this.name = name;
|
||||
|
@ -5,9 +5,9 @@ using System.Linq;
|
||||
namespace DCFApixels.DragonECS
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class | AttributeTargets.Interface, Inherited = false, AllowMultiple = false)]
|
||||
public sealed class MetaTagsAttribute : Attribute
|
||||
public sealed class MetaTagsAttribute : EcsMetaAttribute
|
||||
{
|
||||
private readonly string[] _tags;
|
||||
private readonly string[] _tags = Array.Empty<string>();
|
||||
public IReadOnlyCollection<string> Tags => _tags;
|
||||
|
||||
[Obsolete("With empty parameters, this attribute makes no sense.", true)]
|
||||
|
Loading…
Reference in New Issue
Block a user