打包逻辑完善

dev_chengFeng
JieLing 2020-09-17 12:08:08 +08:00
parent 385bfdbf20
commit 661ee1f796
1 changed files with 3 additions and 2 deletions

View File

@ -15,8 +15,7 @@ public class AutoPack : EditorWindow
[MenuItem("自动化打包/一键导出")]
private static void EzBuildPack()
{
curProjectDir = Environment.CurrentDirectory.Replace('\\', '/');
Debug.Log("当前工程路径:"+curProjectDir);
curProjectDir = Environment.CurrentDirectory.Replace('\\', '/');
string[] _strArr = Directory.GetFiles(curProjectDir + "/AssetBundles/", "*.txt");
Debug.Log("version列表数量:"+_strArr.Length);
for (int i = 0; i < _strArr.Length; i++)
@ -56,6 +55,7 @@ public class AutoPack : EditorWindow
File.Delete(targetPath);
}
File.Copy(copyPath, targetPath, true);
AssetDatabase.Refresh();
if (isBuild)
{
Debug.Log("开始build资源");
@ -96,6 +96,7 @@ public class AutoPack : EditorWindow
Directory.Delete(outPath + "/ex_android_jl/", true);
}
EditorUserBuildSettings.exportAsGoogleAndroidProject = true;
EditorUserBuildSettings.androidBuildSystem = AndroidBuildSystem.Gradle;
// 设置需要打包的场景
string launchScene = _sceneName;
Debug.Log("打包场景:" + launchScene);