/// <summary> /// Generate/Build the context menus for this application. /// </summary> private void InitializeContextMenus() { GUILayout.BeginHorizontal(); // File Menu if (GUILayout.Button("File", EditorStyles.miniButtonLeft)) { GenericMenu contextMenu = new GenericMenu(); contextMenu.AddMenuItem("New", NewTemplate); contextMenu.AddMenuItem("Open", OpenTemplate); contextMenu.AddMenuItem("Save", SaveTemplate); contextMenu.ShowAsContext(); } this.AddCustomContextMenus(); GUILayout.EndHorizontal(); }
/// <summary> /// Adds context menus specific to this utility. /// </summary> protected override void AddCustomContextMenus() { // Edit Menu if (GUILayout.Button("Edit", EditorStyles.miniButtonMid)) { GenericMenu editMenu = new GenericMenu(); editMenu.AddMenuItem("Add Node", AddNode); editMenu.ShowAsContext(); } }