init
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user