アセット
概要
using UnityEngine; public enum JobType { SOLDIER, SORCERER, HUNTER, } public class Example : MonoBehaviour { public int m_id; }
using Sirenix.OdinInspector; using Sirenix.OdinInspector.Editor; using System.Collections.Generic; using UnityEngine; public class ExampleEditor : OdinPropertyProcessor<Example> { public override void ProcessMemberProperties ( List<InspectorPropertyInfo> propertyInfos ) { propertyInfos.AddValue ( "Job Type", ( ref Example e ) => ( JobType )e.m_id, ( ref Example e, JobType jobType ) => e.m_id = ( int )jobType, new EnumToggleButtonsAttribute(), new BoxGroupAttribute( "Group" ) ); propertyInfos.AddDelegate ( "Output", () => Debug.Log( "Pika" ), new BoxGroupAttribute( "Group" ) ); } }
「Property Processors」を使用することで
特定のクラスにプロパティやボタンを付与できます