|
If I use Application.LoadLevel to restart my current scene, it doesn't seem to "reset" everything. I only have one "DontDestroyOnLoad" object in the scene, and if I reload the level from within the level script, this gets duplicated, and the code complains about me trying to "access transforms which have been destroyed". The only way I can get round this is to load up an empty scene and then re-load the level I was in from there, but this is clumsy and takes longer than it should. Any ideas on this? What am I doing wrong?
(comments are locked)
|
|
Two quick comments:
(comments are locked)
|
|
hi i haveing problem then i use appkication.loadlevel in my script it's automatecky loads next lvl from my main meniu lvl my script looks like this were i added application.loadlevel private void DisplayButton() { if(GUI.Button(new Rect(Screen.width/ 2 - 50,STAT_STARTING_POINT + (10 * LINE_HEIGHT),STAT_LABLE_WIDTH,LINEHEIGHT),"Create")); { GameObject gs = GameObject.Find(" _gamesettings"); GameSettings gsScript = gs.GetComponent(); gsScript.SaveCharacterData(); Application.LoadLevel(1); } }
(comments are locked)
|
