Beispiel #1
0
        /// <summary>
        /// 读取配置数据
        /// </summary>
        public static string ReadIniData(string section, string key, string defaultvalue, string path)
        {
            INIParser ini = new INIParser();

            ini.Open(path);
            string value = ini.ReadValue(section, key, defaultvalue);

            ini.Close();
            return(value);
        }
Beispiel #2
0
        private void ReadConfig()
        {
            _configPath = Application.dataPath + "/HTFramework/Editor/Utility/Config/Config.ini";

            INIParser ini = new INIParser();

            ini.Open(_configPath);
            _version       = ini.ReadValue("HTFrameworkEditor", "Version", "<None>");
            _supported     = ini.ReadValue("HTFrameworkEditor", "Supported", "<None>");
            _scripting     = ini.ReadValue("HTFrameworkEditor", "Scripting", "<None>");
            _api           = ini.ReadValue("HTFrameworkEditor", "Api", "<None>");
            _isShowOnStart = EditorPrefs.GetBool(EditorPrefsTable.AboutIsShowOnStart, true);
            ini.Close();
        }
Beispiel #3
0
 private static void OnEditorStart()
 {
     if (EditorApplication.timeSinceStartup < 30)
     {
         if (INIParser.ReadIniData("HTFrameworkEditor", "IsShowOnStart", "0", Application.dataPath + "/HTFramework/Editor/Utility/Config/Config.ini") == "1")
         {
             EditorApplication.delayCall += () =>
             {
                 About about = GetWindow <About>(true, "HTFramework About", true);
                 about.position = new Rect(200, 200, 600, 350);
                 about.minSize  = new Vector2(600, 350);
                 about.maxSize  = new Vector2(600, 350);
                 about.Show();
             };
         }
     }
 }
Beispiel #4
0
        private void AboutGUI()
        {
            GUILayout.BeginVertical();

            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button(_githubGUIContent, EditorGlobalTools.Styles.Label))
            {
                Application.OpenURL("https://github.com/SaiTingHu/HTFramework");
            }
            EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), MouseCursor.Link);
            if (GUILayout.Button(_csdnGUIContent, EditorGlobalTools.Styles.Label))
            {
                Application.OpenURL("https://blog.csdn.net/qq992817263/category_9283445.html");
            }
            EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), MouseCursor.Link);
            GUILayout.EndHorizontal();

            GUILayout.FlexibleSpace();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Unity HTFramework, A framework of client to the unity.");
            GUI.color = Color.yellow;
            if (GUILayout.Button("Check for the latest updates", EditorGlobalTools.Styles.Label))
            {
                Application.OpenURL("https://github.com/SaiTingHu/HTFramework/commits/master");
            }
            EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), MouseCursor.Link);
            GUI.color = Color.white;
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();

            GUILayout.Space(60);

            GUILayout.BeginHorizontal();
            GUILayout.Label("Supported Runtime Platforms: ");
            GUILayout.Label(_pcGUIContent, EditorGlobalTools.Styles.Wordwrapminibutton);
            GUILayout.Label(_androidGUIContent, EditorGlobalTools.Styles.Wordwrapminibutton);
            GUILayout.Label(_webglGUIContent, EditorGlobalTools.Styles.Wordwrapminibutton);
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Supported Unity versions: " + _supported);
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Scripting Runtime Versions: " + _scripting);
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Api Compatibility Level: " + _api);
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUI.color = Color.yellow;
            if (GUILayout.Button("Copyright (c) 2019 HuTao", EditorGlobalTools.Styles.Label))
            {
                Application.OpenURL("https://github.com/SaiTingHu/HTFramework/blob/master/LICENSE");
            }
            EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), MouseCursor.Link);
            GUI.color = Color.white;
            GUILayout.FlexibleSpace();
            bool isShowOnStart = GUILayout.Toggle(_isShowOnStart, "Show On Start");

            if (isShowOnStart != _isShowOnStart)
            {
                _isShowOnStart = isShowOnStart;
                INIParser.WriteIniData("HTFrameworkEditor", "IsShowOnStart", _isShowOnStart ? "1" : "0", _configPath);
            }
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
        }