public void OnDragEnd(StateGraphView view, Vector2 ptInWorld) { var currNode = view.HitTest(ptInWorld); if (currNode == node) { if (!isChild) { return; } currNode = null; } if (currNode != null) { StateNode from; StateNode to; if (isOut) { from = node.Node; to = currNode; } else { to = node.Node; from = currNode; } view.CreateLink(from, to, isChild); view.SelectNode(currNode); } else { //此处弹出创建节点下拉窗口 StateNodeCreatDropdown dropDown = new StateNodeCreatDropdown(view, node, isOut, isChild); dropDown.Show(new Rect(view.Canvas.MouseInView, new Vector2(250, 0))); } }