unity5.x assetbundle打包和加载
发布日期:2021-06-30 19:39:08 浏览次数:3 分类:技术文章

本文共 532 字,大约阅读时间需要 1 分钟。

打包

AssetBundleBuild[] abs = new AssetBundleBuild[1];abs[0].assetNames = new string[]{"Assets/RawAssets/Cube.prefab","Assets/RawAssets/Sphere.prefab"};abs[0].assetBundleName = "myAb.bundle";BundlePipeline.BuildAssetBundles(Application.streamingAssetsPath+"/res",abs,BuildAssetBundleOptions.ChunkBasedCompression,BuildTarget.StandaloneWindows);
加载
AssetBundle ab = AssetBundle.LoadFromFile(Application.streamingAssetsPath+"/res/myAb.bundle");var prefabObj = ab.LoadAsset
("Cube");if(null != prefabObj){ Instantiate(prefabObj);}

转载地址:https://linxinfa.blog.csdn.net/article/details/54865998 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:C#用正则表达式去匹配被双引号包起来的中文
下一篇:5.x依赖打包

发表评论

最新留言

逛到本站,mark一下
[***.202.152.39]2024年04月05日 11时36分58秒