美文网首页
Odin Inspector 系列教程 --- Show In

Odin Inspector 系列教程 --- Show In

作者: su9257_海澜 | 来源:发表于2019-10-11 23:19 被阅读0次

Show In Inline Editors Attribute:用于在Inline中显示对应的属性

using Sirenix.OdinInspector;
using UnityEngine;

public class ShowInInlineEditorsAttributeExample : MonoBehaviour
{
    [InfoBox("单击属性值打开一个新的检查窗口,也可以看到这些属性的不同.")]
    [InlineEditor(Expanded = true)]
    public MyInlineScriptableObject InlineObject;
}

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

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

    [DisableInInlineEditors]//显示但是是灰态
    public string DisabledInInlineEditor;
}

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

相关文章

网友评论

      本文标题:Odin Inspector 系列教程 --- Show In

      本文链接:https://www.haomeiwen.com/subject/niaxmctx.html