Skip to content

Instantly share code, notes, and snippets.

@vbashiri
Last active July 8, 2023 11:19
Show Gist options
  • Save vbashiri/de62a8ce101cb8effed135e8fc60084f to your computer and use it in GitHub Desktop.
Save vbashiri/de62a8ce101cb8effed135e8fc60084f to your computer and use it in GitHub Desktop.
using UnityEditor;
using System.IO;
public class BuildAssetBundles
{
[MenuItem("Assets/Build AssetBundles")]
static void BuildAllAssetBundles()
{
string assetBundleDirectory = "Assets/AssetBundles";
if(!Directory.Exists(assetBundleDirectory))
{
Directory.CreateDirectory(assetBundleDirectory);
}
BuildPipeline.BuildAssetBundles(assetBundleDirectory,
BuildAssetBundleOptions.None,
BuildTarget.Android);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment