unity3d - Application.LoadLevel("string") is obsolete -
this question has answer here:
- unity 5.3 how load current level? 3 answers
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
Post a Comment