Odin Inspector 系列教程 --- Hide In Inline Editors Attribute

Hide In Inline Editors Attribute特性用于:在属性对象的Inline编辑模式中隐藏不需要绘制的属性

using Sirenix.OdinInspector;
using UnityEngine;

    public class HideInInlineEditorsAttributeExample : MonoBehaviour
    {
    [InfoBox("Click the pen icon to open a new inspector window for the InlineObject too see the differences these attributes make.")]
    [InlineEditor(Expanded = true)]
    public MyInlineScriptableObject InlineObject;

    private void Start()
        {
            InlineObject =  ExampleHelper.GetScriptableObject<MyInlineScriptableObject>();
        }
    }

using Sirenix.OdinInspector;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(fileName = "MyInlineScriptableObject_ScriptableObject", menuName = "CreatScriptableObject/MyInlineScriptableObject", order = 100)]
public class MyInlineScriptableObject : ScriptableObject
{
    [ShowInInlineEditors]
    public string ShownInInlineEditor;

    [HideInInlineEditors]//在绘制的里面不显示
    public string HiddenInInlineEditor;
}

更多教程内容详见:革命性Unity 编辑器扩展工具 --- Odin Inspector 系列教程

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容