1
0
mirror of synced 2024-12-18 09:15: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);
}
}
}