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
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
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;
}
}
public HideReferenceObjectPickerAttribute()