Version 3.0.0.2

Odin has a dedicated attribute overview with examples

HideReferenceObjectPickerAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.Delegate | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter | AttributeTargets.All, AllowMultiple = false, Inherited = true)]
[Conditional("UNITY_EDITOR")]
public class HideReferenceObjectPickerAttribute : Attribute, _Attribute
Hides the polymorphic object-picker shown above the properties of non-Unity serialized reference types.
Inheritance
  • System.Object
  • System.Attribute
  • HideReferenceObjectPickerAttribute
Remarks

When the object picker is hidden, you can right click and set the instance to null, in order to set a new value. If you don't want this behavior, you can use attribute to ensure people can't change the value.

Example
public class MyComponent : SerializedMonoBehaviour
{
    [Header("Hidden Object Pickers")]
    [Indent]
    [HideReferenceObjectPicker]
    public MyCustomReferenceType OdinSerializedProperty1;

    [Indent]
    [HideReferenceObjectPicker]
    public MyCustomReferenceType OdinSerializedProperty2;

    [Indent]
    [Header("Shown Object Pickers")]
    public MyCustomReferenceType OdinSerializedProperty3;

    [Indent]
    public MyCustomReferenceType OdinSerializedProperty4;

    public class MyCustomReferenceType
    {
        public int A;
        public int B;
        public int C;
    }
}

Constructors

HideReferenceObjectPickerAttribute()
public HideReferenceObjectPickerAttribute()