I think the only way to make an Asset Bundle in Unity is by using script, this one is taken from Unity official tutorial.
Have a folder named Editor in your Assets folder, and make this script inside it:
using UnityEngine;
using UnityEditor;
using System.IO;
public class CreateAssetBundles
{
[MenuItem("Assets/Build AssetBundles")]
static void BuildAllAssetBundles()
{
string assetBundleDirectory = "Assets/StreamingAssets";
if (!Directory.Exists(Application.streamingAssetsPath))
{
Directory.CreateDirectory(assetBundleDirectory);
}
BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, EditorUserBuildSettings.activeBuildTarget);
}
}
Name the file CreateAssetBundles.cs
And then, I think I better show it to you in this video…
loading...
InvalidOperationException: Building AssetBundles while in play mode is not allowed, please exit play mode first.
As it said, exit play mode…
But, I don’t know what is the real problem.
Don’t use play mode. You just have to choose it from asset menu. And the script should be in editor folder
thanksssssss