Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

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

    jswn7561

    Joined:
    Nov 27, 2018
    Posts:
    7
    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

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    644
    @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.