Hello Guest

Author Topic: Larger Image  (Read 4624 times)

Dipanker

  • Newbie
  • *
  • Posts: 17
    • View Profile
Larger Image
« on: October 09, 2013, 08:19:34 am »
Hi
 I want to know that is there any other way to load large image/sprite in the game, for eg. Candy Crush saga there is large map in before game play. What I did is I divided the image (around 6) and loaded in different sprite collection (1sprite for 1image) and used as map in my game, it works fine but when I come back to particular scene its take lots of time to load.
 Sorry to ask, I have another question that is there a way to release memory before loading to another scene, coz when I switch to another scene sometimes it loads but sometime it crashes.
     Thank you.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Larger Image
« Reply #1 on: October 09, 2013, 09:56:09 am »
Loading time isn't something you can optimize directly - however, you could try using the async load functions to load in the background. You'll still get a pause at some point, but it won't be as bad as directly loading it.


You can try calling UnloadUnusedAssets before loading another scene, but if you're getting occasional crashes, it could be because of any number of things - eg. out of mono memory, etc. You need to identify why its crashing - eg. what memory its running out of, before trying to fix this.

Dipanker

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Larger Image
« Reply #2 on: October 09, 2013, 10:16:43 am »
Hi
   In XCode output message is show as below:

                Received memory warning.
                WARNING -> applicationDidReceiveMemoryWarning()

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Larger Image
« Reply #3 on: October 09, 2013, 10:21:28 am »
Yeah, but that could mean anything. YOu need to profile your apps memory usage, and profile the unity memory usage to narrow it down.