Skip to content

Instantly share code, notes, and snippets.

@pomeloRHO
pomeloRHO / HideWithPropertyAttribute.cs
Created August 1, 2023 19:12
[Unity] Hide field with property state
using UnityEngine;
/// Adding this attribute to a property will hide according to the property `PropName`'s state
public class HideWithPropertyAttribute : PropertyAttribute {
public string PropName;
public bool HideWhenTrue;
public HideWithPropertyAttribute(string propName, bool hideWhenTrue = false) {
PropName = propName;
HideWhenTrue = hideWhenTrue;