public void ShowContextMenu() { if (Type == ConnectionType.In) { return; } var menu = new GenericMenu(); menu.AddItem( new GUIContent("Clear Connections"), false, () => { Undo.RecordObject(_childCollection as Object, "Clear connections"); Links.ClearAllLinks(); _childCollection.ClearConnectionChildren(); DialogueWindow.SaveGraph(); }); menu.ShowAsContext(); }