Search Unity

Application.LoadLevel

Discussion in 'Scripting' started by DaVeF101, May 26, 2015.

  1. DaVeF101

    DaVeF101

    Joined:
    Sep 7, 2014
    Posts:
    134
    I've been trying to solve this annoying bug for awhile now.

    When my iOS game restarts using Application.LoadLevel (the first time), the game freezes for a few seconds... This only happens on the first call, after this it's instant.

    Any ideas?

    XCode log

    2015-05-26 22:31:46.205 JumperRun[383:33770] Nr 1: G:608742452 - 2 - 2015-05-11 19:55:35 +0000


    ***Freezes*

    Unloading 2 Unused Serialized files (Serialized files now loaded: 0)

    UnloadTime: 33.527584 ms

    2015-05-26 22:33:31.803 JumperRun[383:33770] Nr 0: G:1355869793 - 71 - 2015-05-21 22:15:03 +0000
     
    Last edited: May 26, 2015
  2. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    981
    Probably initialization of assets when loading your game. Subsequent calls are probably cached. I don't have iOS nor have the idea behind iOS app lifecycle management, so I am probably wrong.
     
  3. DaVeF101

    DaVeF101

    Joined:
    Sep 7, 2014
    Posts:
    134
    I think I may just right a script to reset the level, as Application.LoadLevel is just reloading the same level again.