Odin has a dedicated attribute overview with examples

DisableContextMenuAttribute 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)]
public sealed class DisableContextMenuAttribute : Attribute, _Attribute

DisableContextMenu is used on any property and disables the context menu for that property.

Use this if you do not want the context menu to be available for a property.

  • System.Object
  • System.Attribute
  • DisableContextMenuAttribute

The following example shows how DisableContextMenu is used on a property.

public class MyComponent : MonoBehaviour
	public Vector3 MyVector;


DisableContextMenuAttribute(Boolean, Boolean)
Initializes a new instance of the DisableContextMenuAttribute class.
public DisableContextMenuAttribute(bool disableForMember = true, bool disableCollectionElements = false)
System.Boolean disableForMember

Whether to disable the context menu for the member itself.

System.Boolean disableCollectionElements

Whether to also disable the context menu of collection elements.


Whether to disable the context menu for collection elements.
public bool DisableForCollectionElements
Whether to disable the context menu for the member itself.
public bool DisableForMember