public static void buildOneKey() { PackControl pc = instance(); pc.packNormal(); pc.buildNormal(); }
public static PackControl instance() { if (_instance == null) { _instance = new PackControl(); } return(_instance); }
static void assetbundleAnalysis() { //WuHuan.AssetBundleFilesAnalyze.analyzeExport = true; //WuHuan.AssetBundleFilesAnalyze.analyzeOnlyScene = true; string targetName = PackControl.instance().getTargetMap().get(EditorUserBuildSettings.activeBuildTarget); string bundlePath = ShineToolGlobal.bundleTempPath + "/" + targetName; string targetPath = ShineToolGlobal.bundleTempPath + "/assetBundleReporter/"; if (!Directory.Exists(targetPath)) { Directory.CreateDirectory(targetPath); } string outputPath = targetPath + targetName + "_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".xlsx"; WuHuan.AssetBundleReporter.AnalyzePrint(bundlePath, outputPath, () => System.Diagnostics.Process.Start(outputPath)); }
protected PackWindow init() { SMap <BuildTarget, string> targetMap = PackControl.instance().getTargetMap(); _targetArr = new BuildTarget[targetMap.size()]; _targetNameArr = new string[targetMap.size()]; _targetIndexMap = new SMap <BuildTarget, int>(); int i = 0; targetMap.forEach((k, v) => { _targetArr[i] = k; _targetNameArr[i] = v; _targetIndexMap[k] = i++; }); selectNormalTarget(); _version = EditorPrefs.GetString("AssetBundleWindow_version"); return(this); }
static void buildToolQuick() { PackControl.instance().buildNormal(); }
static void bundleToolQuick() { PackControl.instance().packNormal(); }
protected override void OnGUI() { GUILayout.Label("选择平台", EditorUtils.labelCenterStyle); _selectTargetIndex = GUILayout.Toolbar(_selectTargetIndex, _targetNameArr); GUILayout.Space(18); _isAll = GUILayout.Toggle(_isAll, new GUIContent("是否全部执行", "是:全量执行,否:增量执行"), GUILayout.Width(100)); _isReleasePack = GUILayout.Toggle(_isReleasePack, new GUIContent("是否正式打包", "是:会成成到cdn目录,并且覆盖版本记录文件,否:本地调试用"), GUILayout.Width(100)); if (_isReleasePack) { _isNewApp = GUILayout.Toggle(_isNewApp, new GUIContent("是否新app", "正式发布用,标记是否有主工程更新"), GUILayout.Width(100)); if (_isNewApp) { _isAppNeedUpdate = GUILayout.Toggle(_isAppNeedUpdate, new GUIContent("是否是必须更新的app", "正式发布用,标记主工程的更新是否客户端必须下载"), GUILayout.Width(200)); } else { _isAppNeedUpdate = false; } _isResourceNeedUpdate = GUILayout.Toggle(_isResourceNeedUpdate, new GUIContent("是否有必更资源", "正式发布用,标记是否变更最低允许资源版本"), GUILayout.Width(100)); makeVersionText(); } else { _isNewApp = false; _isAppNeedUpdate = false; _isResourceNeedUpdate = false; } bool clickPack; GUILayout.BeginHorizontal(); { GUILayout.Space(150); GUIStyle tmpBtStyle = new GUIStyle(GUI.skin.button) { fontSize = 20 }; // ReSharper disable once UnusedVariable using (BgColor bg = new BgColor(Color.green)) { clickPack = GUILayout.Button("资源打包", tmpBtStyle, GUILayout.Width(100), GUILayout.Height(30)); } } GUILayout.EndHorizontal(); GUILayout.Space(30); bool clickBuild; GUILayout.BeginHorizontal(); { GUILayout.Space(150); GUIStyle tmpBtStyle = new GUIStyle(GUI.skin.button) { fontSize = 20 }; // ReSharper disable once UnusedVariable using (BgColor bg = new BgColor(Color.yellow)) { clickBuild = GUILayout.Button("一键出包", tmpBtStyle, GUILayout.Width(100), GUILayout.Height(30)); } } GUILayout.EndHorizontal(); if (clickPack) { if (string.IsNullOrEmpty(_version)) { _version = "1.01"; } PackControl.instance().pack(_targetArr[_selectTargetIndex], _isAll, _isReleasePack, _isNewApp, _isAppNeedUpdate, _isResourceNeedUpdate, makeVersion); Close(); } if (clickBuild) { if (string.IsNullOrEmpty(_version)) { _version = "1.01"; } PackControl.instance().pack(_targetArr[_selectTargetIndex], _isAll, _isReleasePack, _isNewApp, _isAppNeedUpdate, _isResourceNeedUpdate, makeVersion); PackControl.instance().build(_targetArr[_selectTargetIndex]); Close(); } }