mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-26 03:25:22 +00:00
17 lines
507 B
C#
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);
|
||
|
}
|
||
|
}
|