Memory Issue

Hi all,

Currently I am experiencing some memory issues, the game sometimes quits itself when I try to change scenes using Application.LoadLevel, and I suspect its memory issues, because it won’t happen if I remove some of the textures I was using.

I am just wondering which of the following two ways should I be using if I want to change GUITexture.texture?

  1. Put the images in Resource folder and use Resource.Load
  2. Declare a Texture2D variable in the script and drag the image I will be using to the variable through Editor’s Inspector

I am developing on iPad, and the texture size is 1024x768.

It is generally best, if possible, to use public variables and drag texture assets to them in the inspector rather than use Resources.Load. Unity can’t remove unused assets from the Resources folder and there can be problems when Resources.Load is used specifically with textures.