Exemple #1
0
        static SettingModuleEditor()
        {
            var path = SettingSourcePath;

            if (Directory.Exists(path))
            {
                // when build app, ensure compile ALL settings
                KUnityEditorEventCatcher.OnBeforeBuildPlayerEvent -= CompileSettings;
                KUnityEditorEventCatcher.OnBeforeBuildPlayerEvent += CompileSettings;
                // when play editor, ensure compile settings
                KUnityEditorEventCatcher.OnWillPlayEvent -= QuickCompileSettings;
                KUnityEditorEventCatcher.OnWillPlayEvent += QuickCompileSettings;

                // watch files, when changed, compile settings
                new KDirectoryWatcher(path, (o, args) =>
                {
                    if (_isPopUpConfirm)
                    {
                        return;
                    }

                    _isPopUpConfirm = true;
                    KEditorUtils.CallMainThread(() =>
                    {
                        EditorUtility.DisplayDialog("Excel Setting Changed!", "Ready to Recompile All!", "OK");
                        QuickCompileSettings();
                        _isPopUpConfirm = false;
                    });
                });
                Debug.Log("[SettingModuleEditor]Watching directory: " + SettingSourcePath);
            }
        }
Exemple #2
0
        public static void SymbolLinkResource()
        {
            KSymbolLinkHelper.DeleteAllLinks(AssetBundlesLinkPath);
            var exportPath = GetResourceExportPath();
            var linkPath   = GetABLinkPath();

            KSymbolLinkHelper.SymbolLinkFolder(exportPath, linkPath);
            //NOTE 特别无解,同步下无法link这两个目录,使用协程处理后目录内容是空,如果2018及以下版本无EditorCoroutine使用脚本进行link

            /*Log.Info("Add Symbol Link Assetbundle.");
             * ins = new object();
             * EditorCoroutineUtility.StartCoroutine(LinkLua(), ins);
             * Log.Info("Add Symbol Link Lua.");
             * EditorCoroutineUtility.StartCoroutine(LinkSettings(), ins);
             * Log.Info("Add Symbol Link Settings.");*/

            var linkFile = Application.dataPath + "/../AssetLink.sh";

            if (System.Environment.OSVersion.ToString().Contains("Windows"))
            {
                linkFile = Application.dataPath + "/../AssetLink.bat";
            }
            KEditorUtils.ExecuteFile(linkFile);
            AssetDatabase.Refresh();
        }
Exemple #3
0
        // default collector
        /// <summary>
        /// 搜索所有Collector,在所有程序集了
        /// </summary>
        /// <returns></returns>
        public static IList <I18NCollector> FindCollectors()
        {
            var list = new List <I18NCollector>();

            foreach (var type in KEditorUtils.FindAllPublicTypes(typeof(I18NCollector)))
            {
                if (type != typeof(I18NCollector))
                {
                    Debug.Log("Find I18NCollector : " + type.FullName);
                    list.Add((I18NCollector)Activator.CreateInstance(type));
                }
            }
            return(list);
        }
        static SettingModuleEditor()
        {
            var path = SettingSourcePath;

            if (Directory.Exists(path))
            {
                new KDirectoryWatcher(path, (o, args) =>
                {
                    if (_isPopUpConfirm)
                    {
                        return;
                    }

                    _isPopUpConfirm = true;
                    KEditorUtils.CallMainThread(() =>
                    {
                        EditorUtility.DisplayDialog("Excel Setting Changed!", "Ready to Recompile All!", "OK");
                        DoCompileSettings(false);
                        _isPopUpConfirm = false;
                    });
                });
                Debug.Log("[SettingModuleEditor]Watching directory: " + SettingSourcePath);
            }
        }
    void DrawBuildUI()
    {
        GUILayout.BeginHorizontal("HelpBox");
        EditorGUILayout.LabelField("== 生成安装包 ==");
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("打开安装包目录", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(20)))
        {
            var path = AppConfig.ProductRelPath + "/Apps/" + KResourceModule.GetBuildPlatformName();
            OpenFolder(path);
        }
        if (GUILayout.Button("下载更新调试", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(20)))
        {
            if (!File.Exists(AppConfig.VersionTextPath))
            {
                var pyPath   = Path.GetDirectoryName(Path.GetFullPath(Application.dataPath + "/../../build_tools/"));
                var platform = KResourceModule.GetBuildPlatformName();
                //执行bat
                var path = $"{pyPath}/生成filelist-{platform}.bat";
                KEditorUtils.ExecuteCommand(path);
                //执行py传的参数有些错误
                // var abPath = KResourceModule.ProductPathWithoutFileProtocol+"/Bundles/"+platform;
                // BuildTools.ExecutePyFile(pyPath + "/gen_filelist.py",$"{pyPath} {abPath} {platform}");
            }
            if (!File.Exists(AppConfig.VersionTextPath))
            {
                Log.LogError($"未生成filelist,请再试一次或手动执行py脚本");
                return;
            }
            var dstPath = KResourceModule.AppDataPath + AppConfig.VersionTxtName;
            if (File.Exists(dstPath))
            {
                File.Delete(dstPath);
            }
            File.Copy(AppConfig.VersionTextPath, dstPath);
            Log.Info($"文件拷贝成功,{AppConfig.VersionTextPath}->{dstPath}");
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("打PC版", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(20)))
        {
            KAutoBuilder.PerformWinReleaseBuild();
        }

        if (GUILayout.Button("打PC版-Dev", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(20)))
        {
            KAutoBuilder.PerformWinBuild();
        }

        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("打Android版", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(20)))
        {
            KAutoBuilder.PerformAndroidBuild();
        }

        if (GUILayout.Button("打IOS版", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(20)))
        {
            KAutoBuilder.PerformiOSBuild();
        }

        GUILayout.EndHorizontal();


        GUILayout.BeginHorizontal();


        GUILayout.EndHorizontal();
    }