How To Load Next Scene in Unity 5.3 Version without Destroying any GameObject?
Hello Everyone in Unity community! Im new to unity. i have used a little bit unity version 4.5 before but now im going to use unity Version 5.3. its changed. well how can i load a scene over another scene in this version.
Answer by mikelortega · Jan 15, 2016 at 05:03 PM
Use this:
SceneManagement.SceneManager.LoadScene(int or string);
string would mean the name of the scene to load.
int would mean the index of the scene in the Build Settings to load.
im sorry #mikelo but what u wrote it destroy the previous scene(Objects) that were loaded. Like("LoadLevelAdditive()") is there any way?
Then use the second parameter, LoadScene$$anonymous$$ode, and set it to Additive:
Scene$$anonymous$$anager.LoadScene(xxx, LoadScene$$anonymous$$ode.Additive);
Another option, protect the objects you want to keep with Object.DontDestroyOnLoad.
yep i got it about the LoadScene$$anonymous$$ode. thanx #mikelo.
Answer by kristoof · Jan 19, 2016 at 05:02 PM
can i use something like Application.loadLevel(Application.loadedlevel +1);
?
That code looks right if you check that Application.loadedlevel+1 exists.
But take into acount that Application will be deprecated in future versions. You should use Scene$$anonymous$$anager ins$$anonymous$$d.
yep upgraded to 5.3 and its not working i just really not like scenemanager :c
anyone else want to use the code above in utnity 5.3 :
int indexSC = Scene$$anonymous$$anager.GetActiveScene().buildIndex;
Scene$$anonymous$$anager.LoadScene(indexSC +1);