Hello Comunity,
I have been developing mobile apps for over a year now. The apps are fairly simple, having only one scene where I move through the menus and instantiate levels etc. I've had no issues until now.
I am working on a slightly more complicated 2d shooter. The number of assets and prefabs has increased considerably. The thing is when the game starts there is nothing loaded in the scene. There is only the main menu active on the canvas and an empty scene in the background. However, the game crashes immediately after the splashscreen. I am sure it is because the project has grown big because on an earlier build, where I had a smaller number of prefabs, the game took a lot to load on iphone 5, but it worked. In the meantime, i've added new character assets, including 2d textures and created new prefabs in the project view and now it crashes immediately.
I checked the code, nothing is different that what i've been doing on other games.
The message i get in xcode is this:
OPENGL LOG: Creating OpenGL ES 2.0 graphics device ; Context level ; Context handle 358101232
Initialize engine version: 2018.2.1f1 (1a9968d9f99c)
WARNING -> applicationDidReceiveMemoryWarning()
Message from debugger: Terminated due to memory issue.
What I don't understand is why is memory being used in excess if nothing is loaded in the scene. Do assets in the Resources folder use up memory although they are not being used actively in the game?
Should I use separate scenes? For the main menu, for each stage etc.?
What can I do to fix this memory crash issue?
Thanks in advance,
Alex
↧