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

24 lines
738 B
C#
Raw Permalink Normal View History

2021-11-26 11:16:25 +03:00
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;
}
}