游戏开发unity资源管理系列:SpritePacker与SpriteAtlas对AssetBundle资源的影响的区别

先上结论,后续有时间再补充。

使用spritepacker时,prefab(或其他类型的资源)会自动关联到对应图片所在的ab(在StreamingAssets.manifest可以看到其Dependencies是有对应的ab包的路径),而且可以从ab包中直接加载到对应的sprite(LoadAsset<Sprite>() or LoadAssetAsync<Sprite>() )

而spriteatlas,需要先从ab包加载对应的spriteatlas资源,再从spriteatlas获取单个sprite,过程是比较繁琐的(SpriteAtlas sa = LoadAsset<SpriteAtlas>() or LoadAssetAsync<SpriteAtlas>() ; Sprite s = sa.GetSprite() )。而且使用spriteatlas,prefab(或其他类型的资源)无法自动关联到对应图片所在的ab(在StreamingAssets.manifest可以看到其Dependencies不包含有对应的ab包的路径)

猜你喜欢

转载自blog.csdn.net/qq1090504117/article/details/109594408