Odin Attributes 为Unity开发者提供了更多的自定义选项,使得开发过程更加高效和愉悦。通过使用这些特性,开发者可以创建更加专业和用户友好的编辑器界面,从而提升整个开发团队的工作效率。
Hide In Inline Editors 特性用于在属性对象的 InlineEditor 模式中隐藏不需要绘制的属性。
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();
}
}
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;
}