Search Unity

Can't Load Sprite From Bundle?? "xxx.LoadAsset(xx)" as Sprite always return null??

Discussion in 'Scripting' started by JohnSonLi, Dec 27, 2018.

  1. JohnSonLi

    JohnSonLi

    Joined:
    Apr 15, 2012
    Posts:
    586
    Code (csharp):
    1. LoadAsset(xx) as Texture
    returns something.
    But
    Code (csharp):
    1. LoadAsset(xx) as Sprite
    always null. How to save Sprite and its settings in assetbundle and how can I load it out??
     
  2. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Spites aren't currently serialized correctly in AssetBundles. Your best bet is to use something else.