Fixed bug when moving a connection
This commit is contained in:
parent
a6e9038da5
commit
c24a52bee8
@ -1,4 +1,6 @@
|
|||||||
using UnityEditor.Experimental.GraphView;
|
using UnityEditor.Experimental.GraphView;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace ImageProcessingGraph.Editor
|
namespace ImageProcessingGraph.Editor
|
||||||
{
|
{
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
@ -7,7 +9,7 @@ namespace ImageProcessingGraph.Editor
|
|||||||
public GraphPort inputPort;
|
public GraphPort inputPort;
|
||||||
public GraphPort outputPort;
|
public GraphPort outputPort;
|
||||||
|
|
||||||
public Edge internalEdge;
|
[SerializeField] public Edge internalEdge;
|
||||||
|
|
||||||
public GraphConnection(GraphPort inputPort, GraphPort outputPort, Edge internalEdge)
|
public GraphConnection(GraphPort inputPort, GraphPort outputPort, Edge internalEdge)
|
||||||
{
|
{
|
||||||
|
@ -43,9 +43,27 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
|||||||
window.asset.Connections.Remove(VARIABLE);
|
window.asset.Connections.Remove(VARIABLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void OnDrop(UnityEditor.Experimental.GraphView.GraphView graphView, Edge edge)
|
public void OnDrop(UnityEditor.Experimental.GraphView.GraphView graphView, Edge edge)
|
||||||
{
|
{
|
||||||
|
List<GraphConnection> connections = new List<GraphConnection>();
|
||||||
|
|
||||||
|
foreach (var conn in window.asset.Connections)
|
||||||
|
{
|
||||||
|
if (conn.internalEdge == edge)
|
||||||
|
{
|
||||||
|
connections.Add(conn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var VARIABLE in connections)
|
||||||
|
{
|
||||||
|
window.asset.Connections.Remove(VARIABLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.m_EdgesToCreate.Clear();
|
this.m_EdgesToCreate.Clear();
|
||||||
this.m_EdgesToCreate.Add(edge);
|
this.m_EdgesToCreate.Add(edge);
|
||||||
this.m_EdgesToDelete.Clear();
|
this.m_EdgesToDelete.Clear();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user