From 614e2faeaedcbeb514dccf9887c8477453bca7e5 Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Sat, 9 Mar 2024 23:20:29 +0800 Subject: [PATCH] add DebuggerProxy for TypeMeta --- src/Debug/EcsDebugUtility.cs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/Debug/EcsDebugUtility.cs b/src/Debug/EcsDebugUtility.cs index 38ac0ec..ed89bd9 100644 --- a/src/Debug/EcsDebugUtility.cs +++ b/src/Debug/EcsDebugUtility.cs @@ -1,6 +1,7 @@ using DCFApixels.DragonECS.Internal; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Reflection; @@ -315,6 +316,8 @@ namespace DCFApixels.DragonECS MetaGroup Group { get; } IReadOnlyCollection Tags { get; } } + + [DebuggerTypeProxy(typeof(DebuggerProxy))] public sealed class TypeMeta : ITypeMeta { internal readonly Type _type; @@ -510,6 +513,34 @@ namespace DCFApixels.DragonECS { return Name; } + private class DebuggerProxy : ITypeMeta + { + private readonly TypeMeta _meta; + public string Name + { + get { return _meta.Name; } + } + public MetaColor Color + { + get { return _meta.Color; } + } + public string Description + { + get { return _meta.Description; } + } + public MetaGroup Group + { + get { return _meta.Group; } + } + public IReadOnlyCollection Tags + { + get { return _meta.Tags; } + } + public DebuggerProxy(TypeMeta meta) + { + _meta = meta; + } + } #endregion }