Search Unity

How to properly Unload SpriteAtlas

Discussion in '2D' started by zee_ola05, Jul 10, 2019.

  1. zee_ola05

    zee_ola05

    Joined:
    Feb 2, 2014
    Posts:
    166
    I need to load and unload my SpriteAtlases to manually manage the memory used by my textures.

    I'm storing my SpriteAtlas in Resources folder. Loading works fine, but unloading my SpriteAtlas doesn't.

    I load it using my atlas using this code:
    Resources.Load<SpriteAtlas>("MySpriteAtlas");

    I try to unload my atlas using:
    Resources.UnloadAsset(spriteAtlas);


    Has anyone tried doing this? Any insight helps.