はじめに
「Unity3d-Tags-Filters」を Unity プロジェクトに導入することで
定数をカテゴリ分けして Inspector で設定できるようになります
使用例
using Homebrew; using UnityEngine; public static class Constants { [TagField( categoryName = "type1" )] public const int Fire = 0; [TagField( categoryName = "type1" )] public const int Water = 1; [TagField( categoryName = "type1" )] public const int Grass = 2; [TagField( categoryName = "type2" )] public const int Dark = 3; [TagField( categoryName = "type2" )] public const int Steel = 4; [TagField( categoryName = "type2/type3" )] public const int Fairy = 5; } public class Example : MonoBehaviour { [TagFilter( typeof( Constants ) )] public int m_value; }