casting to Sprite from LoadAssetAsync AssetBundleRequest.asset

Hello,

I have a bunch of Sprites in an Asset Bundle. I can get the sprite by the LoadAsset command

Sprite sprite = backgroundCanvasAssetBundle.LoadAsset(fullpathIncludingFileName, typeof(Sprite)) as Sprite;

However, if I use the LoadAssetAsync command, which give me an AssetBundleRequest I can only get a Texture2D from the AssetBundleRequest.asset. Meaning I have to use Sprite.Create (which is slow)

Texture2D texture = requestedAssets[i].asset as Texture2D;
Sprite sprite = Sprite.Create(texture,newRect(0, 0, spriteSize, spriteSize),newVector2(-1f,-1f),spritePixelsPerUnit);

This doesn’t work:
Sprite sprite = requestedAssets[i].asset as Sprite;

Am I missing something ? Or can you not cast as a type with AssetBundleRequest.asset?

Did you ever find a solution? I’m having the same issue.

Sadly not. Had to keep the old clunky load system until there’s a work around. Anyone else have this?

This now works correctly (see updated docs Unity - Scripting API: AssetBundle.LoadAssetAsync)
eg:

backgroundCanvasAssetBundle.LoadAssetAsync(fullpathIncludingFileName, typeof(Sprite)) ;

will return a AssetBundleRequest which, when completed. will have a Sprite .asset