Version 2.1.0.0

Odin has a dedicated attribute overview with examples

HideReferenceObjectPickerAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface, AllowMultiple = false, Inherited = true)]
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()