Foldout Group Attribute特性:可用于任何屬性膘格,并將屬性組織為折疊峭范。使用它來(lái)組織屬性,并允許用戶隱藏當(dāng)前與他們不相關(guān)的屬性瘪贱。
可使用$特殊標(biāo)識(shí)符獲取一個(gè)成員的值作為Foldout的名稱
using Sirenix.OdinInspector;
using UnityEngine;
public class FoldoutGroupAttributeExample : MonoBehaviour
{
[FoldoutGroup("Group")]
public int A;
[FoldoutGroup("Group")]
public int B;
[FoldoutGroup("Group")]
public int C;
[FoldoutGroup("Collapsed group", expanded: true)]
public int D;
[FoldoutGroup("Collapsed group")]
public int E;
[FoldoutGroup("$GroupTitle", expanded: true)]
public int One;
[FoldoutGroup("$GroupTitle")]
public int Two;
public string GroupTitle = "Dynamic group title";
}