My current project uses AssetBundles to load content, however it is being built out for Android, thus resulting in Pink shaders in Editor. This is just one hiccup im having, however i do intend to also deploy on IOS. With this being the case, Using the AssetBundle Manager, Can I generate Asset Bundles for many build types in the same project window or do i need to open a separate, duplicate project for the IOS build and AssetBundles?
I am also copying and loading the bundles from StreamingAssets, which i suspect may complicate things as there will be multiple copies of each asset bundle per build target in that case.
I know this is a little old, but for what it’s worth, below is a class that I use for that. As far as I know, there’s no way to use the AssetBundle Manager to do this same thing.
public class CreateAssetBundles
{
static private BuildTarget[] supportedTargets = new BuildTarget[]
{
BuildTarget.iOS,
BuildTarget.StandaloneWindows,
BuildTarget.Android,
};
static private void BuildAssetBundle(BuildTarget target)
{
Debug.LogWarning("Building AssetBundles for target: " + target);
string assetBundleDirectory = "z_Build/AssetBundles/"+target.ToString();
if (!Directory.Exists(assetBundleDirectory))
{
Directory.CreateDirectory(assetBundleDirectory);
}
BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, target);
Debug.LogWarning("Assetbundles built to dir: " + assetBundleDirectory);
}
[MenuItem("Assets/Build AssetBundles/Windows")]
static void BuildAssetBundlesWindows()
{
BuildAssetBundle(BuildTarget.StandaloneWindows);
}
[MenuItem("Assets/Build AssetBundles/All")]
static void BuildAssetBundlesAll()
{
foreach (BuildTarget target in supportedTargets)
{
BuildAssetBundle(target);
}
}
}