Quantcast
Channel: Questions in topic: "assetbundle.loadasync"
Viewing all articles
Browse latest Browse all 39

AssetBundleManager.LoadAssetAsync() doesn't work on some android devices (or is very slow)

$
0
0
Hi guys,
I'm having a strange problem with the AssetBundleManager.LoadAssetAsync() method on some android devices.
All desktop and iOS platforms work fine, with art loading close to instantly.
A samsung galaxy s5 is able to load the card art, with a very slight delay (microseconds).
But a samsung galaxy s7 and a galaxy tablet is unable to load the cardart sprites (some users report it will randomly appear, after a veeerry long wait).
I was using unity 2017.2, but went back to 5.6.2 hoping the issue would resolve. No luck.
One difference I could see between the devices is that the galaxy s5 has a microsd card, and some of the gamedata appears to be stored on there. Not sure if this is relevant, but just thought I'd mention (in case there is some performance benefit with having streamingassets on a sd card)
Here is the code of what I am trying to do: (which is a copy of the sample from here: https://docs.unity3d.com/Manual/AssetBundles-Manager.html)
AssetBundleLoadAssetOperation request = AssetBundleManager.LoadAssetAsync("cardart", card["Art"], typeof(Sprite)); //if no cardart to load, try again next update if (request == null) { yield break; } else { //run the method to get the card art yield return StartCoroutine(request); Sprite newimage = request.GetAsset(); if (newimage != null) { cardart.sprite = newimage; yield break; } }
Has anyone else seen this problem? What am i doing wrong? Is there an alternative to LoadAssetAsync() I can try? I'm happy to post more code (The full AssetBundleManager class that I am using) if that helps with analysis?
Could someone please assist as I am going nuts trying to resolve this, and it's holding up the android release of the game!!
Any response is much appreciated
Cheers
Navil

Viewing all articles
Browse latest Browse all 39

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>