15 private Vector2 scrollPos;
18 [MenuItem(
"XCharts/Upgrade Check")]
19 public static void ShowWindow()
21 window = GetWindow<CheckVersionEditor>();
22 window.titleContent =
new GUIContent(
"XCharts Upgrade Check");
23 window.minSize =
new Vector2(550, window.minSize.y);
28 void OnInspectorUpdate()
37 GUILayout.Label(
"The current version: " + mgr.nowVersion);
38 if (mgr.needUpdate && !mgr.isCheck)
40 GUILayout.Label(
"The remote version: " + mgr.newVersion);
42 if (mgr.isCheck) GUILayout.Label(
"check ...");
43 else if (mgr.isNetworkError) GUILayout.Label(
"check failed: " + mgr.networkError);
46 GUILayout.Label(
"There is a new version to upgrade!");
50 if (!
string.IsNullOrEmpty(mgr.desc))
52 GUILayout.Label(mgr.desc);
54 if (GUILayout.Button(
"Github Homepage"))
56 Application.OpenURL(
"https://github.com/monitor1394/unity-ugui-XCharts");
58 if (GUILayout.Button(
"Star Support"))
60 Application.OpenURL(
"https://github.com/monitor1394/unity-ugui-XCharts/stargazers");
62 if (GUILayout.Button(
"Issues"))
64 Application.OpenURL(
"https://github.com/monitor1394/unity-ugui-XCharts/issues");
66 if (!
string.IsNullOrEmpty(mgr.changeLog))
68 scrollPos = GUILayout.BeginScrollView(scrollPos);
69 GUILayout.TextArea(mgr.changeLog);
70 GUILayout.EndScrollView();
75 if (mgr.isCheck) GUILayout.Label(
"The remote version: checking ...");
76 else if (mgr.isNetworkError) GUILayout.Label(
"check failed: " + mgr.networkError);
77 else GUILayout.Label(
"The remote version: " + mgr.newVersion);
80 if (!mgr.isNetworkError && !mgr.needUpdate && !mgr.isCheck)
82 GUILayout.Label(
"It is the latest version!");
85 if (!
string.IsNullOrEmpty(mgr.desc))
87 GUILayout.Label(mgr.desc);
89 if (GUILayout.Button(
"Github Homepage"))
91 Application.OpenURL(
"https://github.com/monitor1394/unity-ugui-XCharts");
93 if (GUILayout.Button(
"Star Support"))
95 Application.OpenURL(
"https://github.com/monitor1394/unity-ugui-XCharts/stargazers");
97 if (GUILayout.Button(
"Issues"))
99 Application.OpenURL(
"https://github.com/monitor1394/unity-ugui-XCharts/issues");
101 if (mgr.isNetworkError && GUILayout.Button(
"Check Again"))