From 46d093339c8141bec892747edf2dc0292a0e8161 Mon Sep 17 00:00:00 2001 From: Icarus <1375400884@qq.com> Date: Fri, 27 Sep 2019 00:48:34 +0800 Subject: [PATCH] =?UTF-8?q?!W=20=E7=BB=98=E5=88=B6GroupName?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/Editor/NodeEditorGUI.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Scripts/Editor/NodeEditorGUI.cs b/Scripts/Editor/NodeEditorGUI.cs index 3555023..1bc7fa9 100644 --- a/Scripts/Editor/NodeEditorGUI.cs +++ b/Scripts/Editor/NodeEditorGUI.cs @@ -24,6 +24,7 @@ namespace XNodeEditor { Controls(); DrawGrid(position, zoom, panOffset); + _drawGroupName(); DrawDraggedConnection(); DrawConnections(); DrawNodes(); @@ -40,6 +41,19 @@ namespace XNodeEditor { GUI.matrix = m; } + private void _drawGroupName() + { + var guiContent = new GUIContent(this.graph.name); + var col = EditorStyles.label.normal.textColor; + var fontSize = EditorStyles.label.fontSize; + EditorStyles.label.fontSize = 48; + var size = GUILayoutUtility.GetRect(guiContent, EditorStyles.label); + EditorStyles.label.normal.textColor = new Color(175 / 255f, 185 / 255f, 185 / 255f); + EditorGUI.LabelField(new Rect(new Vector2(5, 5), size.size), guiContent); + EditorStyles.label.fontSize = fontSize; + EditorStyles.label.normal.textColor = col; + } + public static void BeginZoomed(Rect rect, float zoom, float topPadding) { GUI.EndClip();