Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. We're excited to be bringing you the newest Unity features, news, demos, and we've even got some special guests from some of the industry’s most storied franchises. Set a reminder to tune in on YouTube here
    Dismiss Notice
  3. Unity 2018.3 is now released.
    Dismiss Notice

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

    jswn7561

    Joined:
    Nov 27, 2018
    Posts:
    4
    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:
    120
    @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.