Tri-Inspector/Runtime/Attributes/HideIfAttribute.cs
2022-08-03 11:38:52 +03:00

25 lines
653 B
C#

using System;
using System.Diagnostics;
namespace TriInspector
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = true)]
[Conditional("UNITY_EDITOR")]
public class HideIfAttribute : Attribute
{
public HideIfAttribute(string condition) : this(condition, true)
{
}
public HideIfAttribute(string condition, object value)
{
Condition = condition;
Value = value;
}
public string Condition { get; }
public object Value { get; }
public bool Inverse { get; protected set; }
}
}