Search Unity

Loading Sprite Atlases on runtime [solved]

Discussion in 'General Graphics' started by Oshigawa, Dec 21, 2019.

  1. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Hello guys,

    i've got a small memory issue which translates to long loading time on startup. I'm currently using one big Sprite Atlas which holds all the game textures.

    I know how to make Sprite Atlases, but what i don't know is how to omit Sprite Atlas from loading into memory until i tell Unity to do so. I read the scripting API for Sprite Atlas and Sprite Atlas workflow, but i found nothing useful for my problem.

    What i imagined to do was load one Sprite Atlas on startup for first level, load the second one (but keep the first one in memory too) on the second level and so on, so instead of loading X GB of texture data on startup i can split the loading time to X GB/Level Number. Sure, that will impact draw calls, but it's a desktop game so i'm not worried about that.
     
  2. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Ah, i should learn how to read. There's Late Binding, but took me a while to find it.
     
  3. xiahvc_unity

    xiahvc_unity

    Joined:
    May 11, 2018
    Posts:
    11
    Hi
    I have the same issue.
    Ten atlases exist (include in build), and I don't want all atlases to be loaded into memory at the same time as the app starts.
    How can I solve this?