Enum Paging 特性用于在 Inspector 中使用下一个和上一个按钮绘制枚举选择器,以便循环访问枚举属性的可用值。
【EnumPaging】比较简单,直接使用就好
using Sirenix.OdinInspector;
using UnityEngine;
public class EnumPagingAttributeExample : MonoBehaviour
{
[EnumPaging]
public SomeEnum SomeEnumField;
public enum SomeEnum
{
A, B, C
}
[ShowInInspector]
[EnumPaging, OnValueChanged("SetCurrentTool")]
[InfoBox("Changing this property will change the current selected tool in the Unity editor.")]
private UnityEditor.Tool sceneTool;
private void SetCurrentTool()
{
UnityEditor.Tools.current = this.sceneTool;
}
}