public static void Build(BuildTarget buildTarget) { AssetDatabase.RemoveUnusedAssetBundleNames(); EditorUserBuildSettings.androidBuildSubtarget = MobileTextureSubtarget.ASTC; if (!Directory.Exists(Application.streamingAssetsPath)) { Directory.CreateDirectory(Application.streamingAssetsPath); } BuildLua.GenLuaBytes(); // 生成lua _BuildAllAssetBundles(buildTarget); // 生成assetBundle GenerateFileAllocationTable(buildTarget); // 根据lua和assetbundle生成manifest _PrepareResources(System.IO.Path.Combine(Application.dataPath, "StreamingAssets"), false); // 将资源拷贝入 StreamingAssets if (Directory.Exists(XManifest.updateRenameResOutputPath)) { Directory.Delete(XManifest.updateRenameResOutputPath, true); //清理上次的资源 } _PrepareResources(XManifest.updateRenameResOutputPath, true); // 准备自动更新资源 // gen manifest.txt into StreamingAssets AssetDatabase.Refresh(); Debug.Log("<color=yellow>[Build] Build Resource Complete!</color>"); }
static void Build_LuaAndResources_Execute() { BuildLua.target = target; BuildLua.BuildLuaScript(); BuildResourcesExecute(); }