Odin Attributes 为Unity开发者提供了更多的自定义选项,使得开发过程更加高效和愉悦。通过使用这些特性,开发者可以创建更加专业和用户友好的编辑器界面,从而提升整个开发团队的工作效率。
Hide In Tables 特性用于在使用 Table List 特性绘制的表中隐藏字段。
using Sirenix.OdinInspector;
using System;
using System.Collections.Generic;
using UnityEngine;
public class HideInTablesAttributeExample : MonoBehaviour
{
[PropertySpace(0,40)]
public MyItem Item = new MyItem();
[TableList] //以表格形式展示List中的成员
public List TableItemList = new List()
{
new MyItem(),
new MyItem(),
new MyItem(),
};
[Serializable]
public class MyItem
{
public string A;
public int B;
[HideInTables] //此字段在表格中不显示
public int Hidden;
}
}