From 6ae3f65b1223c7acd819414407d656a8661e2542 Mon Sep 17 00:00:00 2001 From: Chafik Achache Date: Tue, 9 May 2017 16:32:11 -0400 Subject: [PATCH] [case 907908] Fixed GraphVisualizer changing the global style of the labels --- .../PlayableGraphVisualizerWindow.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Assets/Editor/GraphVisualizer/PlayableGraphVisualizerWindow.cs b/Assets/Editor/GraphVisualizer/PlayableGraphVisualizerWindow.cs index aa9869c..64b7669 100644 --- a/Assets/Editor/GraphVisualizer/PlayableGraphVisualizerWindow.cs +++ b/Assets/Editor/GraphVisualizer/PlayableGraphVisualizerWindow.cs @@ -67,12 +67,21 @@ private PlayableGraphInfo GetSelectedGraphInToolBar(IList gra return selectedDirector; } - private void ShowMessage(string msg) + private static void ShowMessage(string msg) { - GUIStyle centeredStyle = GUI.skin.GetStyle("Label"); - centeredStyle.alignment = TextAnchor.UpperCenter; - int width = 15 * msg.Length; - GUI.Label(new Rect(0.5f * (Screen.width - width), 0.5f * (Screen.height - 50), width, 50), msg, centeredStyle); + GUILayout.BeginVertical(); + GUILayout.FlexibleSpace(); + + GUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + + GUILayout.Label(msg); + + GUILayout.FlexibleSpace(); + GUILayout.EndHorizontal(); + + GUILayout.FlexibleSpace(); + GUILayout.EndVertical(); } void Update()