Skip to content

Commit 725f664

Browse files
svc-reach-platform-supportEvergreen
authored andcommitted
[Port] [6000.2] [VFX][Fix] Remove VFXEdgeDragInfo
1 parent a11b4f5 commit 725f664

File tree

6 files changed

+0
-303
lines changed

6 files changed

+0
-303
lines changed

Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXEdgeConnector.cs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -33,35 +33,6 @@ protected override void OnMouseMove(MouseMoveEvent e)
3333

3434
s_PickedList.Clear();
3535
view.panel.PickAll(e.mousePosition, s_PickedList);
36-
37-
VFXDataAnchor anchor = s_PickedList.OfType<VFXDataAnchor>().FirstOrDefault();
38-
39-
if (anchor != null)
40-
view.StartEdgeDragInfo(this.edgeDragHelper.draggedPort as VFXDataAnchor, anchor);
41-
else
42-
view.StopEdgeDragInfo();
43-
}
44-
45-
protected override void OnMouseUp(MouseUpEvent e)
46-
{
47-
base.OnMouseUp(e);
48-
49-
if (!e.isPropagationStopped)
50-
return;
51-
52-
VFXView view = m_Anchor.GetFirstAncestorOfType<VFXView>();
53-
if (view == null)
54-
return;
55-
view.StopEdgeDragInfo();
56-
}
57-
58-
protected override void Abort()
59-
{
60-
base.Abort();
61-
if (m_Anchor.GetFirstAncestorOfType<VFXView>() is { } view)
62-
{
63-
view.StopEdgeDragInfo();
64-
}
6536
}
6637

6738
static List<VisualElement> s_PickedList = new List<VisualElement>();

Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXEdgeDragInfo.cs

Lines changed: 0 additions & 144 deletions
This file was deleted.

Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXEdgeDragInfo.cs.meta

Lines changed: 0 additions & 11 deletions
This file was deleted.

Packages/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -46,70 +46,6 @@ private static AssetMoveResult OnWillMoveAsset(string sourcePath, string destina
4646
}
4747
}
4848

49-
class EdgeDragInfo : VisualElement
50-
{
51-
VFXView m_View;
52-
public EdgeDragInfo(VFXView view)
53-
{
54-
m_View = view;
55-
var tpl = Resources.Load<VisualTreeAsset>("uxml/EdgeDragInfo");
56-
tpl.CloneTree(this);
57-
58-
this.AddStyleSheetPath("EdgeDragInfo");
59-
60-
m_Text = this.Q<Label>("title");
61-
62-
pickingMode = PickingMode.Ignore;
63-
m_Text.pickingMode = PickingMode.Ignore;
64-
}
65-
66-
Label m_Text;
67-
68-
public void StartEdgeDragInfo(VFXDataAnchor draggedAnchor, VFXDataAnchor overAnchor)
69-
{
70-
string error = null;
71-
if (draggedAnchor != overAnchor)
72-
{
73-
if (draggedAnchor.direction == overAnchor.direction)
74-
{
75-
if (draggedAnchor.direction == Direction.Input)
76-
error = "You must link an input to an output";
77-
else
78-
error = "You must link an output to an input";
79-
}
80-
else if (draggedAnchor.controller.connections.Any(t => draggedAnchor.direction == Direction.Input ? t.output == overAnchor.controller : t.input == overAnchor.controller))
81-
{
82-
error = "An edge with the same input and output already exists";
83-
}
84-
else if (!draggedAnchor.controller.model.CanLink(overAnchor.controller.model))
85-
{
86-
error = "The input and output have incompatible types";
87-
}
88-
else
89-
{
90-
bool can = draggedAnchor.controller.CanLink(overAnchor.controller);
91-
92-
if (!can)
93-
{
94-
if (!draggedAnchor.controller.CanLinkToNode(overAnchor.controller.sourceNode, null))
95-
error = "The edge would create a loop in the operators";
96-
else
97-
error = "Link impossible for an unknown reason";
98-
}
99-
}
100-
}
101-
if (error == null)
102-
style.display = DisplayStyle.None;
103-
else
104-
m_Text.text = error;
105-
106-
var layout = overAnchor.connector.parent.ChangeCoordinatesTo(m_View, overAnchor.connector.layout);
107-
108-
style.top = layout.yMax + 16;
109-
style.left = layout.xMax;
110-
}
111-
}
112-
11349
struct VFXViewSettings
11450
{
11551
private bool m_IsAttachedLocked;
@@ -3336,26 +3272,6 @@ public void AssetMoved()
33363272
}
33373273
}
33383274

3339-
VFXEdgeDragInfo m_EdgeDragInfo;
3340-
3341-
public void StartEdgeDragInfo(VFXDataAnchor draggerAnchor, VFXDataAnchor overAnchor)
3342-
{
3343-
if (m_EdgeDragInfo == null)
3344-
{
3345-
m_EdgeDragInfo = new VFXEdgeDragInfo(this);
3346-
Add(m_EdgeDragInfo);
3347-
m_EdgeDragInfo.style.display = DisplayStyle.None;
3348-
}
3349-
3350-
m_EdgeDragInfo.StartEdgeDragInfo(draggerAnchor, overAnchor);
3351-
}
3352-
3353-
public void StopEdgeDragInfo()
3354-
{
3355-
if (m_EdgeDragInfo != null)
3356-
m_EdgeDragInfo.StopEdgeDragInfo();
3357-
}
3358-
33593275
public void DuplicateBlackboardFieldSelection()
33603276
{
33613277
var selectedBlackFields = selection

Packages/com.unity.visualeffectgraph/Editor/UIResources/uss/VFXEdgeDragInfo.uss

Lines changed: 0 additions & 24 deletions
This file was deleted.

Packages/com.unity.visualeffectgraph/Editor/UIResources/uss/VFXEdgeDragInfo.uss.meta

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)