You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System.IO;
|
|
|
|
|
using UnityEditor;
|
|
|
|
|
|
|
|
|
|
public class CreateAssetBundles
|
|
|
|
|
{
|
|
|
|
|
[MenuItem("Assets/Build AssetBundles")]
|
|
|
|
|
static void BuildAllAssetBundles()
|
|
|
|
|
{
|
|
|
|
|
// string assetBundleDirectory = "Assets/AssetBundles";
|
|
|
|
|
string assetBundleDirectory = "Assets/StreamingAssets";
|
|
|
|
|
if (!Directory.Exists(assetBundleDirectory))
|
|
|
|
|
{
|
|
|
|
|
Directory.CreateDirectory(assetBundleDirectory);
|
|
|
|
|
}
|
|
|
|
|
#if UNITY_EDITOR_LINUX
|
|
|
|
|
BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, BuildTarget.StandaloneLinux64);
|
|
|
|
|
#else
|
|
|
|
|
BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows64);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|