赞
踩
- using UnityEditor;
- using System.IO;
-
- public class CreateAssetBundles {
-
- //在Unity菜单栏中“Assets”下拉菜单中添加“Build AssetBundles”
- [MenuItem("Assets/Build AssetBundles")]
- static void BuildAllAssetBundles()
- {
- string assetBundleDirectory = "Assets/AssetBundles";
- if (!Directory.Exists(assetBundleDirectory)) {
- //如果目录中没有“AssetBundles”文件夹,就新建该文件夹
- Directory.CreateDirectory(assetBundleDirectory);
- }
- //在 “Assets/AssetBundles”目录下构建到目标平台为StandaloneWindows64的AB包
- BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows64);
- }
-
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。