Skip to content

Commit 68adfe6

Browse files
committed
Update editor laytout
1 parent a3e713c commit 68adfe6

File tree

2 files changed

+36
-15
lines changed

2 files changed

+36
-15
lines changed

Assets/JCSUnity/Editor/JCSUnity_About.cs

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace JCSUnity
1616
/// <summary>
1717
/// About info window.
1818
/// </summary>
19-
public class JCSUnity_About : EditorWindow // TODO(jenchieh): change to normal window.
19+
public class JCSUnity_About : EditorWindow
2020
{
2121
/* Variables*/
2222

@@ -33,23 +33,44 @@ public class JCSUnity_About : EditorWindow // TODO(jenchieh): change to normal
3333

3434
/* Functions */
3535

36+
public JCSUnity_About()
37+
{
38+
titleContent = new GUIContent("About JCSUnity");
39+
}
40+
3641
private void OnGUI()
3742
{
3843
ReadINIFile();
3944

40-
GUILayout.Label("About JCSUnity", EditorStyles.boldLabel);
41-
4245
// Informations
43-
GUILayout.Label("Author: " + EDITOR_INI["author"]);
44-
GUILayout.Label("Email: " + EDITOR_INI["email"]);
45-
GUILayout.Label("Project Version: " + EDITOR_INI["project_version"]);
46+
JCSUnity_EditortUtil.BeginHorizontal(() =>
47+
{
48+
GUILayout.Label("Author: ", EditorStyles.boldLabel);
49+
GUILayout.Label(EDITOR_INI["author"]);
50+
});
4651

47-
// GUI.Button that is drawn in the Label style.
48-
if (GUILayout.Button("Source: " + EDITOR_INI["url"], "Label"))
52+
JCSUnity_EditortUtil.BeginHorizontal(() =>
4953
{
50-
string url = EDITOR_INI["url"];
51-
Application.OpenURL(url);
52-
}
54+
GUILayout.Label("Email: ", EditorStyles.boldLabel);
55+
GUILayout.Label(EDITOR_INI["email"]);
56+
});
57+
58+
JCSUnity_EditortUtil.BeginHorizontal(() =>
59+
{
60+
GUILayout.Label("Version: ", EditorStyles.boldLabel);
61+
GUILayout.Label(EDITOR_INI["version"]);
62+
});
63+
64+
JCSUnity_EditortUtil.BeginHorizontal(() =>
65+
{
66+
GUILayout.Label("Source: ", EditorStyles.boldLabel);
67+
68+
if (GUILayout.Button(EDITOR_INI["url"], "Label"))
69+
{
70+
string url = EDITOR_INI["url"];
71+
Application.OpenURL(url);
72+
}
73+
});
5374
}
5475

5576
/// <summary>
@@ -68,12 +89,12 @@ public static void ReadINIFile()
6889
/// About JCSUnity.
6990
/// </summary>
7091
[MenuItem("JCSUnity/About", false, 100)]
71-
private static void AboutJCSUnity()
92+
public static void AboutJCSUnity()
7293
{
73-
JCSUnity_About window = (JCSUnity_About)GetWindow(typeof(JCSUnity_About));
94+
var window = CreateInstance<JCSUnity_About>();
7495
window.minSize = new Vector2(WINDOW_WIDTH, WINDOW_HEIGHT);
7596
window.maxSize = new Vector2(WINDOW_WIDTH, WINDOW_HEIGHT);
76-
window.Show();
97+
window.ShowUtility();
7798
}
7899
}
79100
}

Assets/JCSUnity/Editor/ini/editor.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# JCSUnity editor properties.
33
#
44
editor_title=JCSUnity
5-
project_version=2.2.0
5+
version=2.2.0
66
email=jcs090218@gmail.com
77
author=Jen-Chieh Shen
88
url=https://github.com/jcs090218/JCSUnity

0 commit comments

Comments
 (0)