From ef76ab1e2de04ceb96a5c2957564e4984a05b00e Mon Sep 17 00:00:00 2001 From: MichaelO Date: Wed, 2 Nov 2022 17:59:23 +0800 Subject: [PATCH] fixed rename manifest issue --- CHANGELOG.md | 3 +++ Editor/AssetBundleBuildTab.cs | 11 +++++++++-- package.json | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 514493e..1747a7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog (unofficial) +## [1.9.1] - 2022-11-02 +- Fixed rename manifest doesn't process MainManifest.manifest rename issue. + ## [1.9.0] - 2022-11-02 - Added Rename Manifest feature (optional). - Modified BundleBuildMap.BuildAssetBundles() static method params (added renameManifest param). diff --git a/Editor/AssetBundleBuildTab.cs b/Editor/AssetBundleBuildTab.cs index dbc2faa..57269d5 100644 --- a/Editor/AssetBundleBuildTab.cs +++ b/Editor/AssetBundleBuildTab.cs @@ -662,6 +662,12 @@ internal static bool Md5ForBundleName(string outputDirectory) return true; } + /// + /// Rename main manifest file + /// + /// + /// + /// internal static bool RenameManifest(string outputDirectory, string newName) { // outputDirectory last path name = manifestName @@ -680,16 +686,17 @@ internal static bool RenameManifest(string outputDirectory, string newName) bundleName = bundleName.Substring(1, bundleName.Length - 1); // only process main manifest file - if (bundleName == manifestName) + if (bundleName == manifestName || bundleName == $"{manifestName}.manifest") { // file name (without extension) string fileName = Path.GetFileNameWithoutExtension(file); // replace it be new file (only replace last) int startIndex = file.LastIndexOf(bundleName); string newFile = file.Remove(startIndex, bundleName.Length).Insert(startIndex, newName); + // specific process + if (bundleName == $"{manifestName}.manifest") newFile = $@"{newFile}.manifest"; // copy override if (File.Exists(file)) File.Move(file, newFile); - break; } } } diff --git a/package.json b/package.json index 2c7b988..19ccbc1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ { "name": "com.unity.assetbundlebrowser.plus", "displayName": "Asset Bundle Browser Plus", - "version": "1.9.0", + "version": "1.9.1", "unity": "2018.1", "description": "The Asset Bundle Browser tool enables the user to view and edit the configuration of asset bundles for their Unity project. It will block editing that would create invalid bundles, and inform you of any issues with existing bundles. It also provides basic build functionality.\n\nUse this tool as an alternative to selecting assets and setting their asset bundle manually in the inspector. It can be dropped into any Unity project with a version of 5.6 or greater. It will create a new menu item in Window > AssetBundle Browser. The bundle configuration, build functionality, and built-bundle inspection are split into three tabs within the new window.", "keywords": ["asset", "bundle", "bundles", "assetbundles"],