Odin Inspector 系列教程 --- Hide Reference Object Picker Attribute

Hide Reference Object Picker Attribute特性:隱藏非Unity序列化引用類型屬性上方顯示的多態對象選擇器。

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


public class HideReferenceObjectPickerAttributeExample : MonoBehaviour
{
    [Title("Hidden Object Pickers")]
    [ShowInInspector]
    [HideReferenceObjectPicker]
    public MyCustomReferenceType OdinSerializedProperty1 = new MyCustomReferenceType();
    [ShowInInspector]
    [HideReferenceObjectPicker]
    public MyCustomReferenceType OdinSerializedProperty2 = new MyCustomReferenceType();
    [ShowInInspector]
    [PropertySpace(40)]
    [Title("Shown Object Pickers")]
    public MyCustomReferenceType OdinSerializedProperty3 = new MyCustomReferenceType();
    [ShowInInspector]
    public MyCustomReferenceType OdinSerializedProperty4 = new MyCustomReferenceType();

    // Protip: 您還可以將HideInInspector屬性放在類定義本身上,以便為所有成員全局隱藏它。
    //[HideReferenceObjectPicker]
    public class MyCustomReferenceType
    {
        public int A;
        public int B;
        public int C;
    }
}

更多教程內容詳見:革命性Unity 編輯器擴展工具 --- Odin Inspector 系列教程

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容