public void OnGUI() { GUILayout.BeginVertical(); { GUILayout.Label("1.脚本打包", EditorGUIHelper.TitleStyle); GUILayout.Space(5); //第二排 GUILayout.BeginHorizontal(); { // if (GUILayout.Button("1.编译dll (.net版)", GUILayout.Width(200), GUILayout.Height(30))) { string str1 = Application.dataPath; string str2 = Application.streamingAssetsPath; ScriptBiuldTools.BuildDLL_DotNet(str1, str2); AssetDatabase.Refresh(); } if (GUILayout.Button("[mono版]", GUILayout.Width(100), GUILayout.Height(30))) { // //u3d的 各种dll ScriptBiuldTools.GenDllByMono(Application.dataPath, Application.streamingAssetsPath + "/" + Utils.GetPlatformPath(Application.platform)); Debug.Log("脚本打包完毕"); } } GUILayout.EndHorizontal(); if (GUILayout.Button("2.生成CLRBinding · one for all", GUILayout.Width(305), GUILayout.Height(30))) { GenCLRBindingByAnalysis(); } if (GUILayout.Button("3.生成跨域Adapter[没事别瞎点]", GUILayout.Width(305), GUILayout.Height(30))) { GenCrossBindAdapter(); } if (GUILayout.Button("4.生成Link.xml", GUILayout.Width(305), GUILayout.Height(30))) { StripCode.GenLinkXml(); } GUI.color = Color.green; GUILayout.Label( @"注意事项: 1.编译服务使用codedom,请放心使用 2.如编译出现报错,请仔细看报错信息,和报错的代码行列, 一般均为语法错 3.语法报错原因可能有:主工程访问hotfix中的类, 使用宏 编译时代码结构发生变化..等等,需要细心的你去发现 " ); GUI.color = GUI.backgroundColor; } GUILayout.EndVertical(); }
public void OnGUI() { GUILayout.BeginVertical(); { GUILayout.Label("1.脚本打包", EditorGUIHelper.TitleStyle); GUILayout.Space(5); //第二排 GUILayout.BeginHorizontal(); { // if (GUILayout.Button("1.编译dll(Roslyn-Release)", GUILayout.Width(155), GUILayout.Height(30))) { RoslynBuild(ScriptBuildTools.BuildMode.Release); } if (GUILayout.Button("编译dll(Roslyn-Debug)", GUILayout.Width(150), GUILayout.Height(30))) { RoslynBuild(ScriptBuildTools.BuildMode.Debug); } } GUILayout.EndHorizontal(); if (GUILayout.Button("2.分析DLL生成绑定", GUILayout.Width(305), GUILayout.Height(30))) { GenCLRBindingByAnalysis(); } if (GUILayout.Button("2.1 手动绑定生成", GUILayout.Width(305), GUILayout.Height(30))) { GenCLRBindingBySelf(); } if (GUILayout.Button("3.生成跨域Adapter[没事别瞎点]", GUILayout.Width(305), GUILayout.Height(30))) { GenCrossBindAdapter(); } if (GUILayout.Button("4.生成Link.xml[大部分不需要]", GUILayout.Width(305), GUILayout.Height(30))) { StripCode.GenLinkXml(); } GUI.color = Color.green; GUILayout.Label(@" 注意事项: 1.编译服务使用Roslyn,请放心使用 2.如编译出现报错,请仔细看报错信息,和报错的代码行列, 一般均为语法错 3.语法报错原因可能有: i.主工程访问hotfix中的类, ii.使用宏编译时代码结构发生变化 ... 等等,需要细心的你去发现"); GUI.color = GUI.backgroundColor; } GUILayout.EndVertical(); }
public void OnGUI() { GUILayout.BeginVertical(); { GUILayout.Label("1.脚本打包", EditorGUIHelper.TitleStyle); GUILayout.Space(5); //第二排 GUILayout.BeginHorizontal(); { // if (GUILayout.Button("1.编译dll(Roslyn-Release)", GUILayout.Width(155), GUILayout.Height(30))) { RoslynBuild(Application.streamingAssetsPath, Application.platform, ScriptBuildTools.BuildMode.Release); } if (GUILayout.Button("编译dll(Roslyn-Debug)", GUILayout.Width(150), GUILayout.Height(30))) { RoslynBuild(Application.streamingAssetsPath, Application.platform, 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(); } BDFrameEditorConfigHelper.EditorConfig.BuildAssetConfig.IsAutoBuildDll = EditorGUILayout.Toggle("是否自动编译热更DLL", BDFrameEditorConfigHelper.EditorConfig.BuildAssetConfig.IsAutoBuildDll); GUI.color = Color.green; GUILayout.Label(@" 注意事项: 1.编译服务使用Roslyn,请放心使用 2.如编译出现报错,请仔细看报错信息,和报错的代码行列, 一般均为语法错 3.语法报错原因可能有: i.主工程访问hotfix中的类, ii.使用宏编译时代码结构发生变化 ... 等等,需要细心的你去发现"); GUI.color = GUI.backgroundColor; } GUILayout.EndVertical(); }
public void OnGUI() { GUILayout.BeginVertical(); { GUILayout.Label("1.脚本打包", EditorGUIHelper.TitleStyle); GUILayout.Space(5); //第二排 GUILayout.BeginHorizontal(); { // if (GUILayout.Button("1.编译dll (.net版)", GUILayout.Width(200), GUILayout.Height(30))) { ScriptBuildTools.BuildDll(Application.dataPath, Application.streamingAssetsPath + "/" + BDUtils.GetPlatformPath(Application.platform), ScriptBuildTools.BuildMode.DotNet); AssetDatabase.Refresh(); } if (GUILayout.Button("[mono版]", GUILayout.Width(100), GUILayout.Height(30))) { //1.build dll var outpath_win = Application.streamingAssetsPath + "/" + BDUtils.GetPlatformPath(Application.platform); ScriptBuildTools.BuildDll(Application.dataPath, outpath_win); //2.同步到其他两个目录 var outpath_android = Application.streamingAssetsPath + "/" + BDUtils.GetPlatformPath(RuntimePlatform.Android) + "/hotfix/hotfix.dll"; var outpath_ios = Application.streamingAssetsPath + "/" + BDUtils.GetPlatformPath(RuntimePlatform.IPhonePlayer) + "/hotfix/hotfix.dll"; var source = outpath_win + "/hotfix/hotfix.dll"; if (source != outpath_android) { File.Copy(source, outpath_android, true); } if (source != outpath_ios) { File.Copy(source, outpath_ios, true); } //3.生成CLRBinding GenCLRBindingByAnalysis(); AssetDatabase.Refresh(); Debug.Log("脚本打包完毕"); } } GUILayout.EndHorizontal(); if (GUILayout.Button("2.生成CLRBinding · one for all[已集成]", GUILayout.Width(305), GUILayout.Height(30))) { GenCLRBindingByAnalysis(); } if (GUILayout.Button("3.生成跨域Adapter[没事别瞎点]", GUILayout.Width(305), GUILayout.Height(30))) { GenCrossBindAdapter(); } if (GUILayout.Button("4.生成Link.xml", GUILayout.Width(305), GUILayout.Height(30))) { StripCode.GenLinkXml(); } GUI.color = Color.green; GUILayout.Label( @"注意事项: 1.编译服务使用codedom,请放心使用 2.如编译出现报错,请仔细看报错信息,和报错的代码行列, 一般均为语法错 3.语法报错原因可能有:主工程访问hotfix中的类, 使用宏 编译时代码结构发生变化..等等,需要细心的你去发现" ); GUI.color = GUI.backgroundColor; } GUILayout.EndVertical(); }
public void Button6() { StripCode.GenLinkXml(); }
public void Init(IQFrameworkContainer container) { SerializeHelper.SerializeContainer.RegisterInstance <IJsonSerializer>(new JsonDotnetSerializer()); mRootLayout = new VerticalLayout(); EasyIMGUI.Label().Text("ScriptKitILRuntime 的编辑器").FontSize(12).Parent(mRootLayout); //EditorStyles.popup.fixedHeight = 30; var verticalLayout = new VerticalLayout("box").Parent(mRootLayout); var versionText = "0"; verticalLayout.AddChild(new HorizontalLayout() .AddChild(EasyIMGUI.Label().Text("版本号(数字):")) .AddChild(EasyIMGUI.TextField() .Text(versionText) .Self(text => text.Content.Bind(t => versionText = t))) ); var versionBtn = EasyIMGUI.Button(); versionBtn.AddLayoutOption(GUILayout.Height(30)); verticalLayout.AddChild(versionBtn.Text("生成版本信息").OnClick(() => { var generatePath = Application.streamingAssetsPath + "/AssetBundles/" + AssetBundleSettings.GetPlatformForAssetBundles(Application.platform) + "/"; var filenames = Directory.GetFiles(generatePath); new DLLVersion() { Assets = filenames.Select(f => f.GetFileName()).ToList(), Version = versionText.ToInt() }.SaveJson(generatePath + "/hotfix.json"); AssetDatabase.Refresh(); })); EasyIMGUI.Custom().OnGUI(() => { GUILayout.BeginVertical(); { showGenDll = EditorGUILayout.BeginFoldoutHeaderGroup(showGenDll, "编译热更dll"); if (showGenDll) { GUILayout.BeginHorizontal(); if (GUILayout.Button("编译dll(Debug)", GUILayout.Height(30))) { var outpath_win = Application.streamingAssetsPath + "/AssetBundles/" + AssetBundleSettings.GetPlatformForAssetBundles(Application.platform); ScriptBuildTools.BuildDll(outpath_win, ScriptBuildTools.BuildMode.Debug); } if (GUILayout.Button("编译dll(Release)", GUILayout.Height(30))) { var outpath_win = Application.streamingAssetsPath + "/AssetBundles/" + AssetBundleSettings.GetPlatformForAssetBundles(Application.platform); ScriptBuildTools.BuildDll(outpath_win, ScriptBuildTools.BuildMode.Release); } GUILayout.EndHorizontal(); GUI.color = Color.green; GUILayout.Label( @"注意事项: 1.编译服务使用Roslyn,请放心使用 2.如编译出现报错,请仔细看报错信息,和报错的代码行列, 一般均为语法错 3.语法报错原因可能有:主工程访问hotfix中的类, 使用宏 编译时代码结构发生变化..等等,需要细心的你去发现" ); GUI.color = GUI.backgroundColor; } EditorGUILayout.EndFoldoutHeaderGroup(); showGenAdapter = EditorGUILayout.BeginFoldoutHeaderGroup(showGenAdapter, "生成跨域Adapter"); if (showGenAdapter) { GUILayout.BeginHorizontal(); GUILayout.Label("程序集名:"); assemblyName = GUILayout.TextField(assemblyName); GUILayout.EndHorizontal(); EditorGUILayout.HelpBox("类名如果有命名空间需要带上", MessageType.Info); GUILayout.BeginHorizontal(); GUILayout.Label("类名:"); adapterClassName = GUILayout.TextField(adapterClassName); GUILayout.EndHorizontal(); if (GUILayout.Button("生成", GUILayout.Height(30))) { GenCrossBindAdapter(); } } EditorGUILayout.EndFoldoutHeaderGroup(); showGenDllBind = EditorGUILayout.BeginFoldoutHeaderGroup(showGenDllBind, "Clr Binding And Link"); if (showGenDllBind) { GUILayout.BeginHorizontal(); if (GUILayout.Button("生成Clr绑定(不知道干嘛别点!)", GUILayout.Height(30))) { GenClrBindingByAnalysis(); } if (GUILayout.Button("生成Link.xml", GUILayout.Height(30))) { StripCode.GenLinkXml(); } GUILayout.EndHorizontal(); } EditorGUILayout.EndFoldoutHeaderGroup(); } GUILayout.EndVertical(); }).Parent(verticalLayout); var runModelPop = new EnumPopupView(ILRuntimeScriptSetting.Default.HotfixRunMode); runModelPop.Style.Value.fixedHeight = 30; runModelPop.AddLayoutOption(GUILayout.Height(30)); runModelPop.ValueProperty.Bind(v => ILRuntimeScriptSetting.Default.HotfixRunMode = (HotfixCodeRunMode)v); EasyIMGUI.Horizontal().AddChild(EasyIMGUI.Label().Text("运行模式")).AddChild(runModelPop).Parent(mRootLayout); }
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(); }