This commit is contained in:
CortexCore
2024-04-16 04:15:06 +08:00
parent b673a9438d
commit 0362b2c606
183 changed files with 5695 additions and 1453 deletions

View File

@@ -10,6 +10,17 @@ namespace BITKit
[AttributeUsage(AttributeTargets.Field)]
public class InjectAttribute : System.Attribute
{
public static void Clear(object obj)
{
var fields = obj.GetType().GetFields(ReflectionHelper.Flags);
foreach (var field in fields)
{
if (field.GetCustomAttributes(typeof(InjectAttribute), true).Length > 0)
{
field.SetValue(obj, null);
}
}
}
public readonly bool CanBeNull;
public InjectAttribute()
{
@@ -39,8 +50,7 @@ namespace BITKit
AsGlobal = asGlobal;
}
}
#if Godot
#else
#if UNITY_64
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Field | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class ExportAttribute : System.Attribute
{