1
0
mirror of synced 2024-12-14 15:22:54 +01:00
WACVR/Assets/Script/Editor/AssetBundleCreator.cs

22 lines
629 B
C#

using UnityEngine;
using UnityEditor;
using System.IO;
public class AssetBundleCreator
{
static string assetBundleDirectory = "Assets/AssetBundles";
[MenuItem("Assets/Build AssetBundles")]
static void BuildAllAssetBundles()
{
if (!Directory.Exists(assetBundleDirectory))
Directory.CreateDirectory(assetBundleDirectory);
try
{
BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, EditorUserBuildSettings.activeBuildTarget);
}
catch (System.Exception e)
{
UnityEngine.Debug.Log(e);
}
}
}