unity3d - Application.LoadLevel("string") is obsolete -


this question has answer here:

i got code has lots of application.loadlevel("whatever");. monodevelop says obsolete , should use scenemanager.loadscene instead. how do that?

actually application.loadlevel("whatever"); line doesn't work unless add corresponding scene "build settings"

just import unityengine.scenemanagement this:

 using unityengine.scenemanagement; 

then replace every application.loadlevel("whatever"); with:

scenemanager.loadscene("whatever"); 

...it can done in 1 line:

unityengine.scenemanagement.scenemanager.loadscene("whatever"); 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -