示例#1
0
        void BuildPart2()
        {
            if (_isBuildResJson)
            {
                EditorUtility.DisplayProgressBar("打包热更资源", "开始发布Res.json", 0f);
                Debug.Log("开始发布Res.json");
                _model.BuildResJsonFile();
            }

            //打开目录
            ZeroEditorUtil.OpenDirectory(FileSystem.CombineDirs(false, _cfg.resDir, ZeroEditorUtil.PlatformDirName));

            EditorUtility.ClearProgressBar();
        }
示例#2
0
        void CreateLinkXML()
        {
            string saveDir = EditorUtility.OpenFolderPanel("选择保存位置", Application.dataPath, "");

            if (string.IsNullOrEmpty(saveDir))
            {
                return;
            }
            var savePath = FileSystem.CombinePaths(saveDir, "link.xml");

            File.WriteAllText(savePath, _cmd.LinkXMLString);
            //打开目录
            ZeroEditorUtil.OpenDirectory(saveDir);
            ShowNotification(new GUIContent("导出完毕!"));
        }
示例#3
0
 void DoSaveView()
 {
     if (GUILayout.Button("保存 link.xml", GUILayout.Height(30)))
     {
         string saveDir = EditorUtility.OpenFolderPanel("选择保存位置", Application.dataPath, "");
         if ("" == saveDir)
         {
             return;
         }
         var savePath = FileSystem.CombinePaths(saveDir, "link.xml");
         File.WriteAllText(savePath, _cmd.LinkXMLString);
         //打开目录
         ZeroEditorUtil.OpenDirectory(saveDir);
         Debug.Log("创建成功");
     }
 }
        void CreateSettingJsonFile()
        {
            var sp = SavePath;

            if (File.Exists(sp) && false == EditorUtility.DisplayDialog("警告!", "已存在文件「setting.json」,是否覆盖?", "Yes", "No"))
            {
                return;
            }

            string jsonStr = LitJson.JsonMapper.ToJson(cfg.data);

            File.WriteAllText(sp, jsonStr);

            //打开目录
            ZeroEditorUtil.OpenDirectory(Path.GetDirectoryName(sp));
        }
示例#5
0
        void BuildPart2()
        {
            if (isBuildResJson)
            {
                EditorUtility.DisplayProgressBar("打包热更资源", "开始发布版本描述文件", 0f);
                Debug.Log("开始发布版本描述文件");
                BuildResJsonFile();
                Debug.Log("版本描述文件发布完成");
            }

            if (isOpenPublishDir)
            {
                //打开目录
                ZeroEditorUtil.OpenDirectory(FileSystem.CombineDirs(false, ZeroEditorConst.PUBLISH_RES_ROOT_DIR));
            }
            else
            {
                EditorUtility.DisplayDialog("", "发布完成!", "确定");
            }

            EditorUtility.ClearProgressBar();
        }
示例#6
0
        void BuildSettingJsonFile()
        {
            if (false == Directory.Exists(ZeroConst.PUBLISH_RES_ROOT_DIR))
            {
                Directory.CreateDirectory(ZeroConst.PUBLISH_RES_ROOT_DIR);
            }

            var filePath = FileSystem.CombinePaths(ZeroConst.PUBLISH_RES_ROOT_DIR, ZeroConst.SETTING_FILE_NAME);

            if (File.Exists(filePath) && false == EditorUtility.DisplayDialog("警告!", "已存在文件「setting.json」,是否覆盖?", "Yes", "No"))
            {
                return;
            }

            UpdateCfg();
            string jsonStr = LitJson.JsonMapper.ToPrettyJson(cfg);

            File.WriteAllText(filePath, jsonStr);

            //打开目录
            ZeroEditorUtil.OpenDirectory(ZeroConst.PUBLISH_RES_ROOT_DIR);
        }
示例#7
0
        void DllGUI()
        {
            _cfg.ilScriptDir = GUIFolderSelect.OnGUI("Dll开发目录:", 200, _cfg.ilScriptDir, Application.dataPath, "", (path) =>
            {
                path = "Assets" + path.Replace(Application.dataPath, "");
                return(path);
            });

            _cfg.ilProjDir = GUIFolderSelect.OnGUI("Dll项目目录", 200, _cfg.ilProjDir, Application.dataPath, "");

            _cfg.ilProjCsprojPath = GUIFileSelect.OnGUI("Dll项目csproj文件:", 200, _cfg.ilProjCsprojPath, Application.dataPath, "csproj");

            GUILayout.BeginHorizontal();
            GUILayout.Label("Devenv工具地址:", GUILayout.Width(200));
            _cfg.devenvPath = EditorGUILayout.TextField(_cfg.devenvPath);
            GUILayout.EndHorizontal();



            GUILayout.BeginHorizontal();

            if (GUILayout.Button("代码拷贝到项目目录"))
            {
                if (EditorUtility.DisplayDialog("警告!", "是否确认执行(目标目录将被覆盖)", "Yes", "No"))
                {
                    _model.Copy2DllProj();
                    ShowNotification(new GUIContent("完成"));
                }
            }

            if (GUILayout.Button("打开DLL项目目录"))
            {
                ZeroEditorUtil.OpenDirectory(Path.GetDirectoryName(_cfg.ilProjCsprojPath));
            }

            GUILayout.EndHorizontal();
        }
示例#8
0
        void Build()
        {
            try
            {
                if (_isBuildDLL)
                {
                    EditorUtility.DisplayProgressBar("打包热更资源", "开始发布DLL", 0f);
                    Debug.Log("开始发布DLL");
                    _model.BuildDll();
                }

                if (_isBuildAB)
                {
                    EditorUtility.DisplayProgressBar("打包热更资源", "开始发布AssetBundle", 0f);
                    Debug.Log("开始发布AssetBundle");
                    //发布AB资源
                    _model.BuildAssetBundle();
                }

                if (_isBuildResJson)
                {
                    EditorUtility.DisplayProgressBar("打包热更资源", "开始发布Res.json", 0f);
                    Debug.Log("开始发布Res.json");
                    _model.BuildResJsonFile();
                }

                //打开目录
                ZeroEditorUtil.OpenDirectory(FileSystem.CombineDirs(false, _cfg.resDir, ZeroEditorUtil.PlatformDirName));
            }
            catch (Exception e)
            {
                Log.E("{0}\n{1}", e.Message, e.StackTrace);
                ShowNotification(new GUIContent(e.Message));
            }
            EditorUtility.ClearProgressBar();
        }