public virtual void DoMouseClick(object sender, MouseButtons button, Point2D worldScpacePos)
 {
     MousePosInWorldSpace = worldScpacePos;
     if (button == MouseButtons.Right)
     {
         OnShowContextMenu.SafeCall(sender, GetContextActions());
     }
 }
    void DrawRightClickContextMenu()
    {
        var genericMenu = new GenericMenu();

        genericMenu.AddItem(new GUIContent(nodeData.isExpanded ? "Collapse" : "Expand"), false, () =>
        {
            nodeData.isExpanded = !nodeData.isExpanded;
        });

        if (OnShowContextMenu != null)
        {
            OnShowContextMenu.Invoke(genericMenu);
        }

        NodeEditor.PostDraw += () => genericMenu.ShowAsContext();
    }