As the warning says “Use SceneManager.LoadScene” you should use SceneManager.LoadScene
instead of Application.LoadLevel
. The only difference is that SceneManager.LoadScene
uses indexes of the scenes ordered in Build Settings and Application.LoadLevel
uses a string of the scene name.
Conclusion: Change Application.LoadLevel
to SceneManager.LoadScene
and pass in the index of the scene you want to load.
If you don’t have using UnityEngine.SceneManagement
make sure you include that because SceneManager.LoadScene
uses that.
solved Unity warning CS0618: ‘Application.LoadLevel(string)’ is obsolete: ‘Use SceneManager.LoadScene’