mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
- ScriptEngine: Added HasCustomAttribute- extension method - ScriptEngine: Added Application class
19 lines
519 B
C#
19 lines
519 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
|
|
namespace GlitchyEngine.Extensions;
|
|
|
|
public static class FieldInfoExtension
|
|
{
|
|
/// <summary>
|
|
/// Returns <see langword="true"/> if the field has the specified attribute.
|
|
/// </summary>
|
|
/// <typeparam name="T">The type of the attribte.</typeparam>
|
|
public static bool HasCustomAttribute<T>(this FieldInfo fiedInfo) where T : Attribute
|
|
{
|
|
return fiedInfo.GetCustomAttribute<T>() != null;
|
|
}
|
|
}
|