2023-06-18 21:49:14 +00:00
|
|
|
using System.IO;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
2022-06-12 19:32:00 +00:00
|
|
|
using UnityEditor;
|
2023-06-18 21:49:14 +00:00
|
|
|
using UnityEditor.Build;
|
|
|
|
using UnityEditor.Build.Reporting;
|
2022-06-12 19:32:00 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|