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 staticTypes { private set; get; } internal List ignoredDeclaringTypes { private set; get; } = new() { typeof(Object), typeof(Behaviour), typeof(MonoBehaviour), typeof(Component) }; /// /// will be managed via code (adding/removing in inspector is) /// public DynamicValueAttribute(DynamicValueType type = DynamicValueType.BySerializedSources, params Type[] staticTypes) { this.type = type; if (type is DynamicValueType.ByStaticTypes) this.staticTypes = staticTypes.ToList(); } } }