CustomContextMenu is used on any property, and adds a custom options to the context menu for the property.

Use this for when you want to add custom actions to the context menu of a property.

namespace Sirenix.OdinInspector
[AttributeUsageAttribute((AttributeTargets)384, AllowMultiple = True, Inherited = True)]
public sealed class CustomContextMenuAttribute : Attribute


Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector

See Also


Definition Description
CustomContextMenuAttribute(string, string) Adds a custom option to the context menu of the property.


Return Type Definition Description
string MenuItem The name of the menu item.
string MethodName The name of the callback method.


The following example shows how CustomContextMenu is used to add a custom option to a property.

public class MyComponent : MonoBehaviour
	[CustomContextMenu("My custom option", "MyAction")]
	public Vector3 MyVector;

	private void MyAction()
		MyVector = Random.onUnitSphere;