Search Unity

Sprite Atlas How to distinguish two Sprite Atlases with the same name according to the SpriteAtlas.tag?

Discussion in '2D Experimental Preview' started by jswn7561, Nov 27, 2018.

  1. jswn7561


    Nov 27, 2018
    Sprite Atlas defaults to the same tag as the name, and there is no official API to modify the tag, which means that if two Sprite Atlases have the same name, it is impossible to distinguish which SpirteAtlas should be loaded according to the tag passed by SpriteAtlasManager.RequestAtlasCallback. Even if the Sprite Atlas's tag is modified through a text editor, it will be automatically modified back to the same value as the name when building AssetBundle. So in order for each Sprite Atlas to have a unique tag, is there any other way except use Sprite Atlas paths or IDs such as GUID as Sprite Atlas names?
    Sorry for my poor English. Unity 2018.2.16f1
  2. Venkify


    Unity Technologies

    Apr 7, 2015
    @jswn7561 Using name was a simple way to tag Atlases. And in most cases you would want to have a unique way to identify the Sprite-Atlas by names if multiple atlases are involved. This is is the recommended way at this point of time.