本文共 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);}
转载地址:http://cukvf.baihongyu.com/