Reputation: 38
Is it possible to add an option to the settings list when you click on the settings icon on a component in the inspector?
Upvotes: 0
Views: 43
Reputation: 90659
You don'T need a CustomEditor for this.
Simply use the [ContextMenu]
attribute like
[ContextMenu("Example")]
private void SomeMethodWithoutParameters()
{
// ...
}
If you are rather talking about adding an entry to an existing internal component you can use a generic [MenuItem]
instead starting with CONTEXT/<ComponentName>
like
[MenuItem ("CONTEXT/Transform/Example")]
static void Example(MenuCommand command)
{
Transform transform = (Transform)command.context;
// do something
}
script has to be placed in a folder called Editor
Upvotes: 1