Able
Askowl Base Library Enabler
ConditionalHideAttribute.cs
1 // Original version of the ConditionalHideAttribute created by Brecht Lecluyse (www.brechtos.com)
2 // Modified by: - Paul Marrington (askowl.net)
3 
4 namespace Askowl {
5  using System;
6  using UnityEngine;
7 
8  /// <a href="http://bit.ly/2OqbrlU">Hide on field in the inspector based on another</a> <inheritdoc />
9  [AttributeUsage(
10  AttributeTargets.Field | AttributeTargets.Property |
11  AttributeTargets.Class | AttributeTargets.Struct)]
12  public class ConditionalHideAttribute : PropertyAttribute {
13  /// <a href="http://bit.ly/2OqbrlU">The name of the field to inspect for hiding another</a>
14  public readonly string SourceFieldName;
15 
16  /// <a href="http://bit.ly/2OqbrlU">The attribute trigger to save the source field name</a>
17  public ConditionalHideAttribute(string sourceFieldName) => SourceFieldName = sourceFieldName;
18  }
19 }
Definition: Clock.cs:3
readonly string SourceFieldName
The name of the field to inspect for hiding another
ConditionalHideAttribute(string sourceFieldName)
The attribute trigger to save the source field name
Hide on field in the inspector based on another