Tri-Inspector/Runtime/Attributes/DisableIfAttribute.cs

25 lines
662 B
C#
Raw Normal View History

using System;
using System.Diagnostics;
namespace TriInspector
{
2022-05-19 10:49:19 -04:00
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = true)]
[Conditional("UNITY_EDITOR")]
2022-08-03 04:18:28 -04:00
public class DisableIfAttribute : Attribute
{
public DisableIfAttribute(string condition) : this(condition, true)
{
}
2022-08-03 04:18:28 -04:00
public DisableIfAttribute(string condition, object value)
{
2022-08-03 04:18:28 -04:00
Condition = condition;
Value = value;
}
2022-08-03 04:18:28 -04:00
public string Condition { get; }
public object Value { get; }
public bool Inverse { get; protected set; }
}
}