using System; using UnityEngine; namespace Funique { /// /// Hide inspect field with condition
/// ------------------------------------------------
/// 隱藏物件欄位 (判斷式) ///
[AttributeUsage(AttributeTargets.Field, AllowMultiple = true)] public class HideIf : PropertyAttribute { /// /// Target serialized object name for condition
/// This must point to a bool field
/// ------------------------------------------------
/// 目標 判斷式欄位名稱
/// 必須指向布林值欄位 ///
public string Target; /// /// What state of the boolean will causing hiding
/// ------------------------------------------------
/// 什麼樣的布林值狀態會導致隱藏 ///
public bool DisabledState; public HideIf(bool state) { Target = string.Empty; DisabledState = state; } public HideIf(string targetName, bool state) { Target = targetName; DisabledState = state; } } }