1
0
mirror of https://github.com/Siccity/xNode.git synced 2026-03-26 22:49:02 +08:00
This commit is contained in:
Icarus 2019-12-03 18:42:38 +08:00
parent 32e375e3da
commit 84c1e9e14d
2 changed files with 10 additions and 2 deletions

View File

@ -207,7 +207,11 @@ namespace XNodeEditor {
//If connection is valid, save it
if (draggedOutputTarget != null) {
XNode.Node node = draggedOutputTarget.node;
if (graph.nodes.Count != 0) draggedOutput.Connect(draggedOutputTarget);
if (graph.nodes.Count != 0)
{
//todo Connect Callback 2019.12.3 18点38分
draggedOutput.Connect(draggedOutputTarget);
}
// ConnectionIndex can be -1 if the connection is removed instantly after creation
int connectionIndex = draggedOutput.GetConnectionIndex(draggedOutputTarget);

View File

@ -125,7 +125,11 @@ namespace XNodeEditor {
/// <summary> Show right-click context menu for hovered port </summary>
void ShowPortContextMenu(XNode.NodePort hoveredPort) {
GenericMenu contextMenu = new GenericMenu();
contextMenu.AddItem(new GUIContent("Clear Connections"), false, () => hoveredPort.ClearConnections());
contextMenu.AddItem(new GUIContent("Clear Connections"), false, () =>
{
//todo Remove Connect Callback 2019.12.3 18点41分
hoveredPort.ClearConnections();
});
if (hoveredPort.IsDynamic)
{
contextMenu.AddItem(new GUIContent("Remove"), false, () => hoveredPort.node.RemoveDynamicPort(hoveredPort));