Esempio n. 1
0
        private void OnDllBuildFinished(DllBuildCommand cmd, bool isSuccess)
        {
            cmd.onFinished -= OnDllBuildFinished;
            if (isSuccess)
            {
                EditorUtility.DisplayProgressBar("生成绑定代码", "解析生成绑定代码", 0.9f);
                try
                {
                    //构建成功后开始解析生成绑定代码
                    GenerateCLRBindingByAnalysis(cmd.assemblyPath, GENERATED_OUTPUT_DIR);
                }
                catch (Exception e)
                {
                    Debug.LogError(e);
                    isSuccess = false;
                }
            }

            if (isSuccess)
            {
                editorWin.ShowTip("完成!");
            }
            else
            {
                editorWin.ShowTip("生成绑定代码失败!");
            }

            EditorUtility.ClearProgressBar();
            AssetDatabase.Refresh();
        }
Esempio n. 2
0
        void GenerateCLRBindingScripts()
        {
            EditorUtility.DisplayProgressBar("生成绑定代码", "清空旧的绑定代码", 0f);
            FileUtil.DeleteFileOrDirectory(GENERATED_OUTPUT_DIR);
            EditorUtility.DisplayProgressBar("生成绑定代码", "构建新的scripts.dll", 0.5f);
            var cmd = new DllBuildCommand(ZeroEditorConst.HOT_SCRIPT_ROOT_DIR, ZeroEditorConst.DLL_PUBLISH_DIR);

            cmd.onFinished += OnDllBuildFinished;
            cmd.Execute();
        }
Esempio n. 3
0
        /// <summary>
        /// 构建热更DLL文件
        /// </summary>
        void BuildDll(Action onBuildSuccess, Action onBuildFail)
        {
            var cmd = new DllBuildCommand(ZeroEditorConst.HOT_SCRIPT_ROOT_DIR, ZeroEditorConst.DLL_PUBLISH_DIR);

            cmd.onFinished += (DllBuildCommand self, bool isSuccess) => {
                if (isSuccess)
                {
                    //继续打包
                    onBuildSuccess?.Invoke();
                }
                else
                {
                    onBuildFail?.Invoke();
                }
            };
            cmd.Execute();
        }