Skip to content

Commit

Permalink
fixed rename manifest issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelO committed Nov 2, 2022
1 parent 56c94dd commit ef76ab1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
11 changes: 9 additions & 2 deletions Editor/AssetBundleBuildTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,12 @@ internal static bool Md5ForBundleName(string outputDirectory)
return true;
}

/// <summary>
/// Rename main manifest file
/// </summary>
/// <param name="outputDirectory"></param>
/// <param name="newName"></param>
/// <returns></returns>
internal static bool RenameManifest(string outputDirectory, string newName)
{
// outputDirectory last path name = manifestName
Expand All @@ -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;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit ef76ab1

Please sign in to comment.