Skip to content

Commit fff0300

Browse files
committed
Updated to 2018.2b and begin to create comment blocks
1 parent 8301bf8 commit fff0300

25 files changed

Lines changed: 193 additions & 25 deletions

Assets/Examples/test.asset

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--- !u!114 &11400000
44
MonoBehaviour:
55
m_ObjectHideFlags: 0
6-
m_PrefabParentObject: {fileID: 0}
6+
m_CorrespondingSourceObject: {fileID: 0}
77
m_PrefabInternal: {fileID: 0}
88
m_GameObject: {fileID: 0}
99
m_Enabled: 1
@@ -13,15 +13,15 @@ MonoBehaviour:
1313
m_EditorClassIdentifier:
1414
serializedNodes:
1515
- type: IntNode
16-
jsonDatas: '{"GUID":"ae7c2124-4d00-43b4-b7aa-bb74213fbf54","position":{"serializedVersion":"2","x":-146.03439331054688,"y":176.942626953125,"width":89.0,"height":97.0},"expanded":false,"output":0}'
16+
jsonDatas: '{"GUID":"ae7c2124-4d00-43b4-b7aa-bb74213fbf54","position":{"serializedVersion":"2","x":-192.03439331054688,"y":124.86260986328125,"width":89.0,"height":97.0},"expanded":false,"output":0}'
1717
- type: IntNode
18-
jsonDatas: '{"GUID":"d3c134a5-f9b1-40fe-8eb4-6a6f6a4a39e0","position":{"serializedVersion":"2","x":-19.13677978515625,"y":134.77178955078126,"width":89.0,"height":97.0},"expanded":false,"output":0}'
18+
jsonDatas: '{"GUID":"d3c134a5-f9b1-40fe-8eb4-6a6f6a4a39e0","position":{"serializedVersion":"2","x":-19.13677978515625,"y":85.77178955078125,"width":89.0,"height":97.0},"expanded":false,"output":0}'
1919
- type: IntNode
20-
jsonDatas: '{"GUID":"240d9400-836b-4fb7-a157-5b7a9ca9318b","position":{"serializedVersion":"2","x":-53.13677978515625,"y":456.65179443359377,"width":89.0,"height":97.0},"expanded":false,"output":0}'
20+
jsonDatas: '{"GUID":"240d9400-836b-4fb7-a157-5b7a9ca9318b","position":{"serializedVersion":"2","x":-185.38693237304688,"y":446.7066955566406,"width":89.00000762939453,"height":97.00001525878906},"expanded":false,"output":0}'
2121
- type: AddNode
2222
jsonDatas: '{"GUID":"17f48d73-bf80-4f52-ae02-d61b2009878c","position":{"serializedVersion":"2","x":196.94322204589845,"y":269.05181884765627,"width":137.0,"height":117.0},"expanded":false,"output":0.0,"test":0}'
2323
- type: IntNode
24-
jsonDatas: '{"GUID":"a1a91bf2-b474-4f89-8235-38a1e71e4c31","position":{"serializedVersion":"2","x":-110.14024353027344,"y":320.9788513183594,"width":89.0,"height":97.0},"expanded":false,"output":0}'
24+
jsonDatas: '{"GUID":"a1a91bf2-b474-4f89-8235-38a1e71e4c31","position":{"serializedVersion":"2","x":-190.8804931640625,"y":265.8685607910156,"width":89.0,"height":97.0},"expanded":false,"output":0}'
2525
edges:
2626
- GUID: f791cb26-6a21-4543-bc76-36ea076545e8
2727
owner: {fileID: 11400000}
@@ -41,5 +41,36 @@ MonoBehaviour:
4141
outputNodeGUID: 240d9400-836b-4fb7-a157-5b7a9ca9318b
4242
inputFieldName: inputs
4343
outputFieldName: output
44-
position: {x: 209.70853, y: -128.78745, z: 0}
45-
scale: {x: 1, y: 1, z: 1}
44+
commentBlocks:
45+
- title: New Comment Block
46+
color: {r: 0, g: 0, b: 0, a: 0}
47+
position:
48+
serializedVersion: 2
49+
x: 240.05603
50+
y: 179.77661
51+
width: 0
52+
height: 0
53+
size: {x: 0, y: 0}
54+
innerNodeGUIDs: []
55+
- title: 'test #42'
56+
color: {r: 0, g: 0, b: 0, a: 0}
57+
position:
58+
serializedVersion: 2
59+
x: -246.41316
60+
y: 55.99635
61+
width: 379
62+
height: 527.99994
63+
size: {x: 416, y: 518}
64+
innerNodeGUIDs: []
65+
- title: olol
66+
color: {r: 0, g: 0, b: 0, a: 0}
67+
position:
68+
serializedVersion: 2
69+
x: 364.36383
70+
y: 133.59766
71+
width: 394.00003
72+
height: 184
73+
size: {x: 361, y: 167}
74+
innerNodeGUIDs: []
75+
position: {x: 221.32254, y: 2.0252616, z: 0}
76+
scale: {x: 0.7561437, y: 0.7561437, z: 1}

Assets/NodeGraphProcessor/Editor/BaseGraphWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void InitializeRootView()
4848

4949
rootView.name = "graphRootView";
5050

51-
rootView.AddStyleSheetPath("Styles/BaseGraphView");
51+
rootView.AddStyleSheetPath("GraphProcessorStyles/BaseGraphView");
5252
}
5353

5454
public void InitializeGraph(BaseGraph graph)

Assets/NodeGraphProcessor/Editor/Resources/Styles.meta renamed to Assets/NodeGraphProcessor/Editor/Manipulators.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
using UnityEngine;
2+
using UnityEditor;
3+
using UnityEditor.Experimental.UIElements;
4+
using UnityEngine.Experimental.UIElements;
5+
using UnityEditor.Experimental.UIElements.GraphView;
6+
using System;
7+
8+
namespace GraphProcessor
9+
{
10+
public class BorderResizer : MouseManipulator
11+
{
12+
bool active;
13+
14+
readonly string cursorBorderStyleSheet = "GraphProcessorStyles/BorderResizer";
15+
16+
public BorderResizer()
17+
{
18+
activators.Add(new ManipulatorActivationFilter { button = MouseButton.LeftMouse });
19+
}
20+
21+
protected override void RegisterCallbacksOnTarget()
22+
{
23+
target.RegisterCallback< MouseDownEvent >(OnMouseDown);
24+
target.RegisterCallback< MouseMoveEvent >(OnMouseMove);
25+
target.RegisterCallback< MouseUpEvent >(OnMouseUp);
26+
27+
if (!target.HasStyleSheetPath(cursorBorderStyleSheet))
28+
target.AddStyleSheetPath(cursorBorderStyleSheet);
29+
}
30+
31+
protected override void UnregisterCallbacksFromTarget()
32+
{
33+
target.UnregisterCallback< MouseDownEvent >(OnMouseDown);
34+
target.UnregisterCallback< MouseMoveEvent >(OnMouseMove);
35+
target.UnregisterCallback< MouseUpEvent >(OnMouseUp);
36+
}
37+
38+
void OnMouseDown(MouseDownEvent e)
39+
{
40+
if (active)
41+
{
42+
e.StopPropagation();
43+
return ;
44+
}
45+
46+
if (MouseCaptureController.IsMouseCaptureTaken())
47+
return ;
48+
49+
var graphElement = e.target as GraphElement;
50+
51+
if (graphElement == null)
52+
return ;
53+
54+
if (CanStartManipulation(e))
55+
{
56+
active = true;
57+
target.TakeMouseCapture();
58+
e.StopPropagation();
59+
}
60+
}
61+
62+
void OnMouseMove(MouseMoveEvent e)
63+
{
64+
if (!active)
65+
return ;
66+
67+
var graphElement = e.target as GraphElement;
68+
69+
graphElement.style.width += e.mouseDelta.x;
70+
graphElement.style.height += e.mouseDelta.y;
71+
}
72+
73+
void OnMouseUp(MouseUpEvent e)
74+
{
75+
if (!active)
76+
return ;
77+
78+
var graphElement = target as GraphElement;
79+
80+
if (CanStopManipulation(e))
81+
{
82+
target.ReleaseMouseCapture();
83+
e.StopPropagation();
84+
85+
GraphView graphView = graphElement.GetFirstAncestorOfType<GraphView>();
86+
if (graphView != null && graphView.elementResized != null)
87+
graphView.elementResized(graphElement);
88+
}
89+
90+
active = false;
91+
}
92+
}
93+
}

Assets/NodeGraphProcessor/Editor/Manipulators/BorderResizer.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/NodeGraphProcessor/Editor/Resources/GraphProcessorStyles.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/NodeGraphProcessor/Editor/Resources/Styles/BaseGraphView.uss renamed to Assets/NodeGraphProcessor/Editor/Resources/GraphProcessorStyles/BaseGraphView.uss

File renamed without changes.

Assets/NodeGraphProcessor/Editor/Resources/Styles/BaseGraphView.uss.meta renamed to Assets/NodeGraphProcessor/Editor/Resources/GraphProcessorStyles/BaseGraphView.uss.meta

File renamed without changes.

Assets/NodeGraphProcessor/Editor/Resources/Styles/BaseNodeView.uss renamed to Assets/NodeGraphProcessor/Editor/Resources/GraphProcessorStyles/BaseNodeView.uss

File renamed without changes.

Assets/NodeGraphProcessor/Editor/Resources/Styles/BaseNodeView.uss.meta renamed to Assets/NodeGraphProcessor/Editor/Resources/GraphProcessorStyles/BaseNodeView.uss.meta

File renamed without changes.

0 commit comments

Comments
 (0)