public static AssetBundleManifest BuildAssetBundles(string outputPath, AssetBundleBuild[] builds, [DefaultValue("BuildAssetBundleOptions.None")] BuildAssetBundleOptions assetBundleOptions, [DefaultValue("BuildTarget.WebPlayer")] BuildTarget targetPlatform)
{
if (!Directory.Exists(outputPath))
{
Debug.LogError("The output path \"" + outputPath + "\" doesn't exist");
return(null);
}
if (builds == null)
{
Debug.LogError("AssetBundleBuild cannot be null.");
return(null);
}
AssetBundleManifest result;
try
{
result = BuildPipeline.BuildAssetBundlesWithInfoInternal(outputPath, builds, assetBundleOptions, targetPlatform);
}
catch (Exception exception)
{
BuildPipeline.LogBuildExceptionAndExit("BuildPipeline.BuildAssetBundles", exception);
result = null;
}
return(result);
}