mirror of
https://github.com/Siccity/xNode.git
synced 2026-03-26 22:49:02 +08:00
!TX todo
This commit is contained in:
parent
32e375e3da
commit
84c1e9e14d
@ -207,7 +207,11 @@ namespace XNodeEditor {
|
|||||||
//If connection is valid, save it
|
//If connection is valid, save it
|
||||||
if (draggedOutputTarget != null) {
|
if (draggedOutputTarget != null) {
|
||||||
XNode.Node node = draggedOutputTarget.node;
|
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
|
// ConnectionIndex can be -1 if the connection is removed instantly after creation
|
||||||
int connectionIndex = draggedOutput.GetConnectionIndex(draggedOutputTarget);
|
int connectionIndex = draggedOutput.GetConnectionIndex(draggedOutputTarget);
|
||||||
|
|||||||
@ -125,7 +125,11 @@ namespace XNodeEditor {
|
|||||||
/// <summary> Show right-click context menu for hovered port </summary>
|
/// <summary> Show right-click context menu for hovered port </summary>
|
||||||
void ShowPortContextMenu(XNode.NodePort hoveredPort) {
|
void ShowPortContextMenu(XNode.NodePort hoveredPort) {
|
||||||
GenericMenu contextMenu = new GenericMenu();
|
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)
|
if (hoveredPort.IsDynamic)
|
||||||
{
|
{
|
||||||
contextMenu.AddItem(new GUIContent("Remove"), false, () => hoveredPort.node.RemoveDynamicPort(hoveredPort));
|
contextMenu.AddItem(new GUIContent("Remove"), false, () => hoveredPort.node.RemoveDynamicPort(hoveredPort));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user