This example shows how to create a context menu inside a custom EditorWindow . class MyWindow extends ...
docs.unity3d.com