Show Buttons in entity editor

- ScriptEngine: Added HasCustomAttribute- extension method
- ScriptEngine: Added Application class
This commit is contained in:
Simon Lübeß
2023-12-12 13:38:29 +01:00
parent 13cb043cf4
commit e69e1b5526
12 changed files with 253 additions and 42 deletions
@@ -0,0 +1,18 @@
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;
}
}