Skip to content

Commit 3755fc5

Browse files
committed
refactoring
1 parent 6a5977b commit 3755fc5

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

Code/Editor/Window/NodeBased/GraphSidePanel.cs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ internal class GraphSidePanel
1515
private GraphEditorWindow _window;
1616
private HashSet<string> _ignoredFields;
1717
private GraphPanelDrawer _panelDrawer;
18-
private Vector2 _scrollPos;
18+
private float _scrollPos;
1919
private float _width;
2020
private bool _opened;
2121
private bool _dragging;
22-
private string[] _toolbarLabels = { "Properties", "Node" };
22+
private string[] _toolbarLabels = { "Graph", "Node" };
2323
private int _selectedIndex;
2424

2525
public float Width => _opened ? _width : 0f;
@@ -66,14 +66,24 @@ public void Draw(bool opened, float height, float winWidth, Event e)
6666
Rect position = new Rect(winWidth - _width, 0f, _width, height);
6767

6868
GUILayout.BeginArea(position, EditorStyles.helpBox);
69-
_selectedIndex = GUILayout.Toolbar(_selectedIndex, _toolbarLabels);
70-
GUILayout.Space(5f);
71-
_scrollPos.y = EditorGUILayout.BeginScrollView(_scrollPos).y;
72-
switch (_selectedIndex)
69+
70+
if (_window.FullDrawing)
71+
{
72+
_scrollPos = EditorGuiLayout.BeginScrollViewVertical(_scrollPos);
73+
_panelDrawer.Draw(_width);
74+
}
75+
else
7376
{
74-
case 0: _panelDrawer.Draw(_width); break;
75-
case 1: DrawNode(); break;
77+
_selectedIndex = GUILayout.Toolbar(_selectedIndex, _toolbarLabels);
78+
GUILayout.Space(5f);
79+
_scrollPos = EditorGuiLayout.BeginScrollViewVertical(_scrollPos);
80+
switch (_selectedIndex)
81+
{
82+
case 0: _panelDrawer.Draw(_width); break;
83+
case 1: DrawNode(); break;
84+
}
7685
}
86+
7787
EditorGUILayout.EndScrollView();
7888
GUILayout.EndArea();
7989

0 commit comments

Comments
 (0)