Search Unity

Issues with Sprite Atlases

Discussion in 'Addressables' started by Rafarel, Mar 25, 2019.

  1. Rafarel

    Rafarel

    Joined:
    Jul 21, 2017
    Posts:
    199
    Hello,

    I'm using Unity 2018.3.7f1 and 0.6.7 Adressables package.
    I have a prefab that referencing 4 AnimationsClips.
    On runtime, I play the animation clips depending on the direction of the movement.
    Animation clips are played with a playable like this :

    Code (CSharp):
    1. AnimationPlayableUtilities.PlayClip(m_animator, m_animations[m_enemy.Direction], out m_playableGraph);
    The prefab is a prefab variant of some kind of enemy base prefab.
    The prefab variant is Adressable, I have an Asset Manager that keeps a reference to the loaded asset and instantiate it when needed, this works perfectly.

    The issue is when I put all the textures used by the Animations clips in a sprite atlas in packed play mode (it works in other play modes).
    The textures are not rendered anymore I just see the life bar of my enemies not the animation.
    If I delete the sprite atlas, everything works again.
    I do build player content every time I play the game.

    I noticed something weird in the memory profiler.
    On the following screenshots I have two atlases for two enemies animations.

    In fast mode I have only one atlas in memory referenced by the SpriteAtlasDatabase.
    In packed mode I have two atlases in memory, one referenced by the SpriteAtlasDatabase and the other by all the sprites that are supposed to be in the atlas... Isn't that weird ? Or it's normal ?

    Here are the screenshots of the two memory snapshots and my Addressables setup

    Fast Mode

    atlas-memory-fast.PNG

    Packed Mode

    atlas-memory-packed.PNG

    Addressables setup

    Addressables-setup.PNG

    In that setup MoleMinerYellow and MushroomRed have a SpriteAtlas that doesn't work in packed mode.
    I removed the MoleNude SpriteAtlas and this is the only prefab that displays the animation well.

    Thanks for your help
     
  2. nik_d

    nik_d

    Joined:
    Apr 27, 2018
    Posts:
    66
    MNNoxMortem and Rafarel like this.
  3. Rafarel

    Rafarel

    Joined:
    Jul 21, 2017
    Posts:
    199
    Thanks, I'll wait for the fix and I'm watching your thread for an update :)