Hide Reference Object Picker Attribute特性:隱藏非Unity序列化引用類型屬性上方顯示的多態(tài)對(duì)象選擇器晕翠。
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;
}
}