From 503fc23aca8b79bbb8b517ab0177a379949dc2f3 Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Wed, 20 Dec 2023 19:07:19 +0800 Subject: [PATCH] fix --- src/EcsRunner.cs | 4 ++-- src/Utils/ReflectionExtensions.cs | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 src/Utils/ReflectionExtensions.cs 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; + } + } +}