using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using System.IO;
public class ExportAssetBudle : MonoBehaviour
{
[MenuItem("Build/ExportScene")]
static void ExportScene()
{
string strCombinePath = Path.Combine(Application.dataPath, "ExoportSceneFile");
//读取外部配置文件获取场景名,这里暂时写死
string strPath = EditorUtility.SaveFilePanel("SaveResource",
strCombinePath, "ABTest", "unity3d");
if (0 != strPath.Length)
{
string[] scenes = { "Assets/Scene/ABTest.unity" };
BuildPipeline.BuildPlayer(scenes,
strPath, BuildTarget.StandaloneWindows64, BuildOptions.BuildAdditionalStreamedScenes);
}
}//function
[MenuItem("Build/ExportResource")]
static void ExportResource()
{
//打印版本号
Debug.LogError("BundleVersion:"+PlayerSettings.bundleVersion);
//打印包体标识码
Debug.LogError("BundleIdentifier:" + PlayerSettings.bundleIdentifier);
//强制清空本地缓存,防止版本号未改变,未改变看不到最新更改的效果
Caching.CleanCache();
//提前存储AsssetBundle(AB包)文件全路径
string strCombinePath = Path.Combine(Application.dataPath, "AssetBundle");
#region Unity编辑器设置AssetBu