This repository has been archived on 2024-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
snakeinabox/Assets/NaughtyAttributes/Scripts/Core/DrawConditionAttributes/ShowIfAttribute.cs
2020-07-09 11:41:01 -07:00

24 lines
770 B
C#

using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class ShowIfAttribute : DrawConditionAttribute
{
public string[] Conditions { get; private set; }
public ConditionOperator ConditionOperator { get; private set; }
public bool Reversed { get; protected set; }
public ShowIfAttribute(string condition)
{
ConditionOperator = ConditionOperator.And;
Conditions = new string[1] { condition };
}
public ShowIfAttribute(ConditionOperator conditionOperator, params string[] conditions)
{
ConditionOperator = conditionOperator;
Conditions = conditions;
}
}
}