unity 的场景打包
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;
public class AssetBundleTest : MonoBehaviour
{
[MenuItem("Custom Editor/AssetBundle/Bundle Scene")]
static void CreateSceneALL()
{
//清空一下缓存
Caching.CleanCache();
List<BundleData> strmes = GetSelectionFile(".unity");
Debug.Log(strmes.Count);
if (strmes.Count <= 0)
return;
string Path=string.Empty;
string filepath = PlayerPrefs.GetString("Path");
foreach (var item in strmes)
{
//获得用户选择的路径的方法,可以打开保存面板(推荐)
if(string.IsNullOrEmpty(Path))
{
if(string.IsNullOrEmpty(filepath))
{
Path = EditorUtility.SaveFilePanel("保存资源", "SS", "" + item.Name, "unity3d");
filepath = Path.Substring(0, Path.LastIndexOf('/'));
}
else
{
Path = filepath+ "/"+item.Name+ ".unity3d";
}
PlayerPrefs.SetString("Path", filepath);
}
//另一种获得用户选择的路径&#x