Hello Guest

Author Topic: Knowing when a sprite collection was loaded or unloaded  (Read 5028 times)

edb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 43
    • View Profile
Knowing when a sprite collection was loaded or unloaded
« on: March 05, 2015, 10:18:21 pm »
I'm looking for a way to know when a sprite collection gets loaded or unloaded to/from a scene.  Preferably I'd just like to be able to put a print() statement where the load/unload happens.  Anybody know where?

What I'm actually looking to do is verify that when I leave a scene, a certain sprite collection is getting unloaded, and when the next scene loads, that same sprite collection is getting reloaded again.

I'm going to make that sprite collection persist in memory and I want a way to verify that it's not hitting the hard drive and reloading every time I change scenes.

Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Knowing when a sprite collection was loaded or unloaded
« Reply #1 on: March 07, 2015, 01:43:18 pm »
Hi,

Its not really possible to get a callback - such is object lifetime in Unity, but you can use Resources.FindObjectsOfTypeAll to see what is loaded at any point to work out if something has been unloaded.

edb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Knowing when a sprite collection was loaded or unloaded
« Reply #2 on: March 07, 2015, 06:15:18 pm »
Thanks for the info.