Skip to content

Commit 6ae3f65

Browse files
author
Chafik Achache
committed
[case 907908] Fixed GraphVisualizer changing the global style of the labels
1 parent 3f20575 commit 6ae3f65

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

Assets/Editor/GraphVisualizer/PlayableGraphVisualizerWindow.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,21 @@ private PlayableGraphInfo GetSelectedGraphInToolBar(IList<PlayableGraphInfo> gra
6767
return selectedDirector;
6868
}
6969

70-
private void ShowMessage(string msg)
70+
private static void ShowMessage(string msg)
7171
{
72-
GUIStyle centeredStyle = GUI.skin.GetStyle("Label");
73-
centeredStyle.alignment = TextAnchor.UpperCenter;
74-
int width = 15 * msg.Length;
75-
GUI.Label(new Rect(0.5f * (Screen.width - width), 0.5f * (Screen.height - 50), width, 50), msg, centeredStyle);
72+
GUILayout.BeginVertical();
73+
GUILayout.FlexibleSpace();
74+
75+
GUILayout.BeginHorizontal();
76+
GUILayout.FlexibleSpace();
77+
78+
GUILayout.Label(msg);
79+
80+
GUILayout.FlexibleSpace();
81+
GUILayout.EndHorizontal();
82+
83+
GUILayout.FlexibleSpace();
84+
GUILayout.EndVertical();
7685
}
7786

7887
void Update()

0 commit comments

Comments
 (0)