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