Unity - A计划(永久有效期) 扫二维码继续学习 二维码时效为半小时

(197评价)
价格: 4431.00元
The AssetBundle 'L12.unity3d' can't be loaded because another AssetBundle with the same files is already loaded.
飞雷神面包发起了问答2018-12-10
1
回复
3550
浏览

我用异步加载 会遇到问题:请问什么原因造成的。

The AssetBundle 'L12.unity3d' can't be loaded because another AssetBundle with the same files is already loaded.

 

if (GetAssetBundle(assetBundlePath) == null)
                    {
                        AssetBundleCreateRequest request = null;
                        try
                        {
                             request = AssetBundle.LoadFromFileAsync(assetBundlePath);
                        }
                        catch
                        {

                        }
                        yield return request;
                        if (request.isDone)
                        {
                            try
                            {
                                AssetBundle temp = request.assetBundle;
                                assetBundleDic.Add(assetBundlePath, temp);
                            }
                            catch
                            {

                            }
                        }
                    }
                    AssetBundle ab = GetAssetBundle(assetBundlePath);
                    AssetBundleRequest abRequest = ab.LoadAssetAsync<Texture>(textureName);
                    yield return abRequest;

                    if (abRequest.isDone)
                    {
                        Texture texture = abRequest.asset as Texture;
                        EventCenter.Broadcast(EventType.SequenceTextureLoaded, texture);
                    }

 

 

 

 

所有回复
  • 老师_Trigger 2018-12-10

    同学你好,这两篇文章里有记录这方面的问题,同学看可以学习一下:

    https://www.cnblogs.com/hewei2012/p/3779134.html

    https://www.cnblogs.com/chongxin/p/5562469.html

    还有-5条回复,点击查看
    你还没有登录,请先登录注册
发表回复
你还没有登录,请先 登录或 注册!