アセット
概要
2.x まで
using Sirenix.OdinInspector; using UnityEngine; [CreateAssetMenu] [InlineEditor] public class Data : SerializedScriptableObject { public Data m_self; [InlineEditor] public PhysicsMaterial2D m_mat; [ShowInInspector] [Title( "Main Camera" )] [InlineEditor] public Camera mainCamera { get { return Camera.main; } } }
2.x から
using Sirenix.OdinInspector; using UnityEngine; [CreateAssetMenu] [InlineEditor( InlineEditorObjectFieldModes.Foldout )] public class Data : SerializedScriptableObject { public Data m_self; [InlineEditor( InlineEditorObjectFieldModes.Foldout )] public PhysicsMaterial2D m_mat; [ShowInInspector] [Title( "Main Camera" )] [InlineEditor( InlineEditorObjectFieldModes.Hidden )] public Camera mainCamera { get { return Camera.main; } } }
「InlineEditor」属性に「InlineEditorObjectFieldModes」の引数を設定することで、
デザインを変更したり、Object Field の欄を非表示にしたりできます