AssetDatabase.GetAssetPathsFromAssetBundle public static string[]GetAssetPathsFromAssetBundle(stringassetBundleName); 描述 返回一个数组,其中包含使用指定资源包名称标记的所有资源的路径。 返回的所有路径均相对于项目文件夹,例如如果向资源包添加了“hello.png”,则返回“Assets/MyTextures/hello.png”。
public static string[] GetAssetPathsFromAssetBundleAndAssetName (string assetBundleName, string assetName); 描述 获取所有标有 assetBundleName 且有指定 assetName 的 资源的资源路径。获取所有标有 assetBundleName 且有指定 assetName 的 资源的资源路径,与其扩展名或路径无关, 例如当 assetName 为"House"时...
3.操纵Asset database中的AssetBundle names接口: AssetDatabase.GetAllAssetBundleNames() AssetDatabase.GetAssetPathsFromAssetBundle AssetDatabase.RemoveAssetBundleName() AssetDatabase.GetUnusedAssetBundleNames() AssetDatabase.RemoveUnusedAssetBundleNames() AssetPostProcessor.OnPostprocessAssetbundleNameChanged 4....
string[] assetPaths = AssetDatabase.GetAssetPathsFromAssetBundleAndAssetName(assetBundleName, assetName); if(assetPaths.Length ==0) { Debug.LogError("There is no asset with name \""+ assetName +"\" in "+ assetBundleName); returnnull; } // @TODO:Now we only get the main object from...
assetBundleMap.AddMap(assetPath, assetBundleName); } public static bool IsAssetPathHasAssetBundleName(string assetPath) { if (assetBundleMap == null) { return false; } return assetBundleMap.assetPathSet.Contains(assetPath); } public static List<string> GetAllAssetBundleNames() ...
GetAssetBundle(@"http://localhost/AssetBundles/" + filePath); yield return request.SendWebRequest(); if (request.isNetworkError || request.isHttpError) { Debug.Log(request.error); } else { ab = DownloadHandlerAssetBundle.GetContent(request); //ab = (request.downloadHandler as DownloadHandler...
dataPath + "/AssetBundles/"; //Manifest文件 string manifestPath = assetBundlePath + manifestName; //首先加载Manifest文件:下载AssetBundle文件 WWW wwwManifest = WWW.LoadFromCacheOrDownload(manifestPath, 0); yield return wwwManifest; if (wwwManifest.error == null) { //创建一个AssetBundle文件的内存...
(1)设置模型资源AssetBundle的位置(先bundlename 赋值,再设置,,创建Editor文件夹,创建继承Editor脚本) [MenuItem("Tools/SetAssetBundleName")]staticvoidSetResourcesAssetBundleName(){DirectoryInforoot=newDirectoryInfo(Application.dataPath+"/Resources/XXX");SearchRoot(root,"");AssetDatabase.RemoveUnusedAssetBundleNa...
Unity3D 本地资源一般放在 Resources 目录下,但是 Resouces 文件夹的大小不能超过 2G,使用 AssetBundle 管理资源可以解决 Resources 文件夹受限问题。 本文代码资源见→基于AssetBundle实现资源热更新(更新版)。 AssetBundle 主要用于管理资源,配合 AssetDatabase 和 AssetImporter 可以实现资源重命名,配合 BuildPipeline 可以...
foreach(ObjectobjinSelectedAsset) { stringsourcePath=AssetDatabase.GetAssetPath(obj); //本地测试:建议最后将Assetbundle放在StreamingAssets文件夹下,如果没有就创建一个,因为移动平台下只能读取这个路径 //StreamingAssets是只读路径,不能写入 //服务器下载:就不需要放在这里,服务器上客户端用www类进行下载。