IEnumerator LoadModel(string path)
{
Debug.Log("开始加载模型");
string filePath = string.Format(path);
UnityWebRequest request;
request = UnityWebRequest.GetAssetBundle(path);
yield return request.Send();
AssetBundle ab = (request.downloadHandler as DownloadHandlerAssetBundle).assetBundle;
if (ab != null)
{
GameObject objModel = null;
objModel = Instantiate(ab.LoadAsset<GameObject>("打包模型名称"));
ab.Unload(false);
ab = null;
}
}
unity加载AssetsBundles
最新推荐文章于 2023-06-28 17:09:46 发布