/// <summary>
        /// 打包资源
        /// </summary>
        public void BuildAssetBundle(string outputPath, RuntimePlatform platform)
        {
            //ab会先构建代码,提前构建,避免浪费时间
            var ret = PublishPipeLineCI.CheckCode();

            if (ret)
            {
                //生成Assetbundlebunle
                AssetBundleEditorToolsV2.GenAssetBundle(outputPath, platform);
                AssetDatabase.Refresh();
                Debug.Log("资源打包完毕");
            }
        }
Beispiel #2
0
    public void OnGUI()
    {
        if (BDEditorApplication.BDFrameworkEditorSetting == null)
        {
            return;
        }
        //
        var buildDLLSetting = BDEditorApplication.BDFrameworkEditorSetting?.BuildHotfixDLLSetting;

        GUILayout.BeginVertical();
        {
            GUILayout.Label("1.脚本打包", EditorGUIHelper.LabelH2);
            GUILayout.Space(5);
            //第二排
            GUILayout.BeginHorizontal();
            {
                //
                if (GUILayout.Button("1.编译dll(Roslyn-Release)", GUILayout.Width(155), GUILayout.Height(30)))
                {
                    RoslynBuild(Application.streamingAssetsPath, BApplication.RuntimePlatform, ScriptBuildTools.BuildMode.Release);
                }

                if (GUILayout.Button("编译dll(Roslyn-Debug)", GUILayout.Width(150), GUILayout.Height(30)))
                {
                    RoslynBuild(Application.streamingAssetsPath, BApplication.RuntimePlatform, ScriptBuildTools.BuildMode.Debug);
                }
            }
            GUILayout.EndHorizontal();

            if (GUILayout.Button("2.生成跨域Adapter[没事别瞎点]", GUILayout.Width(305), GUILayout.Height(30)))
            {
                GenCrossBindAdapter();
            }

            if (GUILayout.Button("3.生成Link.xml[大部分不需要]", GUILayout.Width(305), GUILayout.Height(30)))
            {
                StripCode.GenLinkXml();
            }

            if (GUILayout.Button("4.预检查工程代码", GUILayout.Width(305), GUILayout.Height(30)))
            {
                PublishPipeLineCI.CheckEditorCode();
            }

            if (BDEditorApplication.BDFrameworkEditorSetting != null)
            {
                buildDLLSetting.IsAutoBuildDll = EditorGUILayout.Toggle("是否自动编译热更DLL", buildDLLSetting.IsAutoBuildDll);
            }

            GUI.color = Color.green;
            GUILayout.Label(@"
注意事项:    
     1.编译服务使用Roslyn,请放心使用
     2.如编译出现报错,请仔细看报错信息,和报错的代码行列,
       一般均为语法错
     3.语法报错原因可能有:
       i.主工程访问hotfix中的类,
       ii.使用宏编译时代码结构发生变化
       ...
       等等,需要细心的你去发现");
            GUI.color = GUI.backgroundColor;
        }
        GUILayout.EndVertical();
    }