private void OnEnable() { unityPluginConfig = DirectoryUtil.CreateScriptableObject <UnityPluginConfig>("preset/plugins-script", false); unityPluginConfigEditor = Editor.CreateEditor(unityPluginConfig) as UnityPluginConfigEditor; projectScriptExportConfig = DirectoryUtil.CreateScriptableObject <ProjectExportConfig>("preset/project-script", false); projectScriptExportConfigEditor = Editor.CreateEditor(projectScriptExportConfig) as ProjectExportConfigEditor; // scenes hierarchyExportConfig = DirectoryUtil.CreateScriptableObject <HierarchyExportConfig>("quickexport/hierarchy", false); hierarchyExportConfigEditor = Editor.CreateEditor(hierarchyExportConfig) as HierarchyExportConfigEditor; sceneExportConfig = DirectoryUtil.CreateScriptableObject <ExportSceneList>("quickexport/scenes", false); sceneExportEditor = Editor.CreateEditor(sceneExportConfig) as ExportSceneListEditor; directoryExportConfig = DirectoryUtil.CreateScriptableObject <ExportDirectoryList>("quickexport/directories", false); directoryExportEditor = Editor.CreateEditor(directoryExportConfig) as ExportDirectoryListEditor; globalConfig = DirectoryUtil.CreateScriptableObject <GlobalConfig>("bridge/entry/GlobalConfig", false); globalConfigEditor = Editor.CreateEditor(globalConfig) as GlobalConfigEditor; rawResourceExportConfig = DirectoryUtil.CreateScriptableObject <RawResourceExportConfig>("quickexport/rawres", false); rawResourceExportConfigEditor = Editor.CreateEditor(rawResourceExportConfig) as RawResourceExportConfigEditor; BeefBall.DoInstallationCheck(); ConfigManager.Init(); }
static void RegisterDelegates() { BeefBall.RegisterPresetCompleteEvent(() => { WXMonoBehaviourExportHelper.exportedResourcesSet.Clear(); isNGUIPreset = false; isUGUIPreset = false; }); }
private void handleClickedOnGUI( bool createProjectButtonClicked, bool choosePathButtonClicked, bool openTargetButtonClicked, bool resetButtonClicked, bool exportButtonClicked ) { if (createProjectButtonClicked) { string createPath = EditorUtility.SaveFolderPanel("选择创建目录", "WXExport", ""); // + "/"; if (createPath != "") { ProjectCreator.createQuickStartProject(createPath); string unityPath = Path.Combine(createPath, "assets/unity"); ExportStore.storagePath = unityPath[unityPath.Length - 1] == '/' ? unityPath : unityPath + "/"; } } if (choosePathButtonClicked) { // 弹出选目录窗口 string savePath = EditorUtility.SaveFolderPanel("选择你的资源导出目录", "WXExport", ""); // + "/"; if (savePath != "") { ExportStore.storagePath = savePath[savePath.Length - 1] == '/' ? savePath : savePath + "/"; } } if (openTargetButtonClicked) { UnityUtil.ShowInExplorer(ExportStore.storagePath); } if (resetButtonClicked) { ExportStore.storagePath = ""; } if (exportButtonClicked) { // targetPlatform不对的提示 if ( EditorUserBuildSettings.activeBuildTarget != BuildTarget.iOS && EditorUserBuildSettings.activeBuildTarget != BuildTarget.Android ) { EditorUtility.DisplayDialog("提示", "检测到您目前Unity项目的BuildTarget并非iOS和Android,导出产物所还原的效果可能不一致", "好的"); } try { currentPreset.Export(); } catch (Exception e) { Debug.LogError(e); EditorUtility.ClearProgressBar(); } BeefBall.OnPresetComplete(); } }
private void OnEnable() { BeefBall.DoInstallationCheck(); }