using UnityEngine; namespace EditorAttributes { /// /// Attribute to enable a field based on a condition /// public class EnableFieldAttribute : PropertyAttribute, IConditionalAttribute { public string ConditionName { get; private set; } public int EnumValue { get; private set; } /// /// Attribute to enable a field based on a condition /// /// The name of the condition to evaluate public EnableFieldAttribute(string conditionName) #if UNITY_2023_3_OR_NEWER : base(true) #endif => ConditionName = conditionName; /// /// Attribute to enable a field based on a condition /// /// The name of the condition to evaluate /// The value of the enum public EnableFieldAttribute(string conditionName, object enumValue) #if UNITY_2023_3_OR_NEWER : base(true) #endif { ConditionName = conditionName; EnumValue = (int)enumValue; } } }