namespace Zinnia.Data.Attribute { using System; using UnityEngine; /// /// Draws the property in a specified restricted way. /// public class RestrictedAttribute : PropertyAttribute { /// /// The restriction options that can be applied. /// [Flags] public enum Restrictions { /// /// The property is de-emphasized. /// Muted = 1 << 0, /// /// The property is always read-only. /// ReadOnlyAlways = 1 << 1, /// /// The property is read-only when the application is playing. /// ReadOnlyAtRunTime = 1 << 2, /// /// The property is read-only when the application is playing and the component is enabled. /// ReadOnlyAtRunTimeAndEnabled = 1 << 4, /// /// The property is read-only when the application is playing and the component is disabled. /// ReadOnlyAtRunTimeAndDisabled = 1 << 8, } /// /// The restriction options to apply. /// public readonly Restrictions restrictions; /// /// Draws the property in a specified restricted way. /// /// The restriction options to apply. public RestrictedAttribute(Restrictions restrictions = Restrictions.ReadOnlyAtRunTime | Restrictions.Muted) { this.restrictions = restrictions; } } }