SamsonGame/Assets/Scripts/Core/Attributes/ConditionalHideAttribute.cs

24 lines
738 B
C#

using UnityEngine;
using System;
//Original version of the ConditionalHideAttribute created by Brecht Lecluyse (www.brechtos.com)
//Modified by: Sebastian Lague
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property |
AttributeTargets.Class | AttributeTargets.Struct, Inherited = true)]
public class ConditionalHideAttribute : PropertyAttribute
{
public string conditionalSourceField;
public int enumIndex;
public ConditionalHideAttribute(string boolVariableName)
{
conditionalSourceField = boolVariableName;
}
public ConditionalHideAttribute(string enumVariableName, int enumIndex)
{
conditionalSourceField = enumVariableName;
this.enumIndex = enumIndex;
}
}