AssetBundles-Browser
AssetBundles-Browser copied to clipboard
Allow building specific asset bundles
currently it's only possible to build ALL asset bundles in the project. In case there are a lot of them, it might be a very time consuming operation.
There should be a way to select which asset bundle(s) to build, and have only those built.
yes, that would be a helpful feature. We are adding that to the addressables system, but will not be adding it here. The reason is that outside of addressables, it is not very realistic for us to provide a build script that can be used consistently in a real-life production environment. The build script in this tool is intended as a sample for people to use as a basis when they create the build script they actually need.
I understand it is only given as a sample, but a few people on some forum threads have asked for that feature which may be a useful thing to use "as is" or base more complex build operations on.
In any case, why did you close this? i was going to implement this and send a PR for it.
If you've got plans to PR it, then I'm happy to keep it open. I had not realized that was your intent. I always welcome PR's
Why was this feature reverted ? (https://github.com/Unity-Technologies/AssetBundles-Browser/commit/af1549c592a37fb0a4df708cbb2f28c099858523)
bump.
This is a very useful feature, in our particular case more useful than Addressables. Just a method which accepts a filter (a string of names) of which ABs to build would be great.
@ivoras isnt this possible with my suggested fix here?
Would you like ne to create a simple static method just like u described? Would that help in any way?
@ivoras isnt this possible with my suggested fix here?
I do not see any posts with your username here. Could you tell me where can I find the suggested fix?
Would you like ne to create a simple static method just like u described? Would that help in any way?
Yes it would - but where? Doesn't this feature need to be in Unity's code?
We are currently using BuildPipeline.BuildAssetBundles()
and with the increasing size of asset bundles (and in our case it's constantly growing), having to rebuild everything often is a big PITA.
@ivoras here is a rough sketch of such a method:
public static void BuildAssetBundlesByName(params string[] assetBundleNames)
{
// Argument validation
if (assetBundleNames == null || assetBundleNames.Length == 0)
{
return;
}
// Remove duplicates from the input set of asset bundle names to build.
assetBundleNames = assetBundleNames.Distinct().ToArray();
List<AssetBundleBuild> builds = new List<AssetBundleBuild>();
foreach (var assetBundle in assetBundleNames)
{
var assetPaths = AssetDatabase.GetAssetPathsFromAssetBundle(assetBundle);
AssetBundleBuild build = new AssetBundleBuild();
build.assetBundleName = assetBundle;
build.assetNames = assetPaths;
builds.Add(build);
}
// TODO: set the desired BuildAssetBundleOptions
BuildPipeline.BuildAssetBundles(@"outputPath", builds.ToArray(), BuildAssetBundleOptions.None, EditorUserBuildSettings.activeBuildTarget);
}
You would need to tweak it a bit (output path, build options) but it should work.
try it https://github.com/michael811125/AssetBundles-Browser-Plus