diff --git a/src/EcsRunner.cs b/src/EcsRunner.cs index a9f54e1..107cdd0 100644 --- a/src/EcsRunner.cs +++ b/src/EcsRunner.cs @@ -1,11 +1,11 @@ -using DCFApixels.DragonECS.RunnersCore; +using DCFApixels.DragonECS.Internal; +using DCFApixels.DragonECS.RunnersCore; using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Reflection; -using System.Runtime.CompilerServices; using System.Text.RegularExpressions; using static DCFApixels.DragonECS.EcsDebugUtility; diff --git a/src/Utils/ReflectionExtensions.cs b/src/Utils/ReflectionExtensions.cs new file mode 100644 index 0000000..2af1c51 --- /dev/null +++ b/src/Utils/ReflectionExtensions.cs @@ -0,0 +1,14 @@ +using System; +using System.Reflection; + +namespace DCFApixels.DragonECS.Internal +{ + internal static class ReflectionExtensions + { + public static bool TryGetAttribute(this MemberInfo self, out T attribute) where T : Attribute + { + attribute = self.GetCustomAttribute(); + return attribute != null; + } + } +}