Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unloading Sprites

Discussion in 'UGUI & TextMesh Pro' started by LightStriker, Jun 25, 2015.

  1. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,716
    Unloading simple texture appear straight forward with Destroy().

    However, Sprite are not the same and they appear to require to pass by Resources.UnloadAsset. However, I see no sign that the associated texture is unloaded too.

    Should I do;

    Code (CSharp):
    1.         Destroy(sprite.texture);
    2.         Resources.UnloadAsset(sprite);
    Unity should really offer better - more unified - way of loading and unloading data.
     
  2. psyydack

    psyydack

    Joined:
    Aug 30, 2013
    Posts:
    93