Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Question about sprite atlases in animation clip

Discussion in 'Addressables' started by johnnyliu806, Mar 12, 2020.

  1. johnnyliu806

    johnnyliu806

    Joined:
    Dec 18, 2017
    Posts:
    2
    Hi,
    I am using Unity 2019.2.20f1 and version of Addressables1.6.0.
    The question is that after loading SpriteAtlas by the addressable system in runtime, it does not work in my animation clip. I confused even I already downloaded all SpriteAtlas and I have to set each sprite in my animation clip? Or any better suggestion?

    Thanks for any help!
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    210
    Hey there @johnnyliu806 - we'll forward this over to the team for you to see if they can help!
     
  3. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,564
    I have the same problem. My sprite frame animation does not show if the sprites are in the atlas.

    Atlas = addressable
    Sprites = not addressable
    Animation = addressable

    If I remove the sprites from atlas, everything works even sprites are not included in the addressable. ( which means the animation dependency can work out the sprites and include it in the addressable data) But not if the sprites are in the atlas.
     
  4. johnnyliu806

    johnnyliu806

    Joined:
    Dec 18, 2017
    Posts:
    2
    This is my solution:

    SpriteAtlasManager.atlasRequested + = RequestAtlas;

    public void RequestAtlas(string tags, Action<SpriteAtlas> action)
    {
    Addressables.LoadAssetAsync<SpriteAtlas>(tags).Completed += (op) =>
    {
    action(op.Result);
    }
    }

    Hope helpful!
     
unityunity