HeavenStudio/Assets/Editor/CreateAssetBundles.cs
minenice55 1dda4f9477
Allow games to load assets from AssetBundles (#102)
* Loading improvements: prepwork for loading from assetbundles

* note for sfx

* cleaner code

* correct type

* put loaded assetbundle in the minigame data instead

also lays groundwork for future localization stuff

* add samurai slice gold, coin toss assetbundles

* very messy "already loaded" checks

* make Dj School load from assetbundle
2022-06-12 12:32:00 -07:00

17 lines
507 B
C#

using UnityEditor;
using UnityEngine;
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);
}
}