mirror of
https://github.com/DCFApixels/DragonECS-AutoInjections.git
synced 2025-09-18 13:24:35 +08:00
15 lines
354 B
C#
15 lines
354 B
C#
using System;
|
|
using System.Reflection;
|
|
|
|
namespace DCFApixels.DragonECS
|
|
{
|
|
internal static class ReflectionExtensions
|
|
{
|
|
public static bool TryGetAttribute<T>(this MemberInfo self, out T attribute) where T : Attribute
|
|
{
|
|
attribute = self.GetCustomAttribute<T>();
|
|
return attribute != null;
|
|
}
|
|
}
|
|
}
|