This commit is contained in:
2026-04-25 23:37:10 +02:00
commit 19d6bd934a
476 changed files with 9198 additions and 0 deletions
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Object = UnityEngine.Object;
namespace RPGCoreCommon.DynamicValues
{
[AttributeUsage(AttributeTargets.Field)]
public class DynamicValueAttribute : PropertyAttribute
{
internal DynamicValueType type { private set; get; }
internal List<Type> staticTypes { private set; get; }
internal List<Type> ignoredDeclaringTypes { private set; get; } = new()
{
typeof(Object),
typeof(Behaviour),
typeof(MonoBehaviour),
typeof(Component)
};
/// <summary>
/// <see cref="DynamicValue"/> will be managed via code (adding/removing in inspector is)
/// </summary>
public DynamicValueAttribute(DynamicValueType type = DynamicValueType.BySerializedSources, params Type[] staticTypes)
{
this.type = type;
if (type is DynamicValueType.ByStaticTypes) this.staticTypes = staticTypes.ToList();
}
}
}