Author Topic: When is Atlas loaded?  (Read 2543 times)

paw9000

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 5
    • View Profile
    • Precocial Software LLC
When is Atlas loaded?
« on: November 08, 2013, 06:07:49 AM »
TLDR: When is the Atlas loaded?  Can I reorder things or is there code I can invoke to cause it to load earlier than the rest of my code?

Long version:
I'm experiencing a problem in the Kindle port of my app where if I load a slighly more memory intensive model in my app the NGUI atlas texture appears all white.  My app lets people make their own models for things and ships with some built in models.  I have a scene with a UI frame work built around letting them edit this model.  When I load the scene with the smaller models everything is fine, but if I give it a bigger dataset the problem happens.  I can't repro it on a Nexus 7, or my iOS port.  Which makes me think I might just be hitting the memory limitations of the Kindle.

My theory is if I get the NGUI Atlas to load before my model then my model should abort loading instead and then at leas the UI would show up and Users could go back and load a different model.
Download my free 3d Unit Origami modeling app made with NGUI at http://www.precocialsoftware.com

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: When is Atlas loaded?
« Reply #1 on: November 08, 2013, 10:52:36 AM »
It's loaded whenever it's referenced. So as soon as you load a scene that uses an atlas, it gets loaded.

A way around it is to use reference atlases, and set the reference atlas to point to nothing before doing a build. This means you will need to do your own Resource.Load, and set the reference atlas to point to the correct data atlas when you need to.