OnLevelWasLoaded deprecated, trying to setup my buttons

Hi,

I’m having trouble setting up my own network manager.

I made a very simple UI with a Start Host button and a Join Game button.

in my script, I have this :

	void OnLevelWasLoaded(int level){
		if (level == 0) {
			SetupMenuSceneButtons ();
		} else {
			SetupOtherSceneButtons ();
		}
	}

	void SetupMenuSceneButtons(){
		GameObject.Find ("ButtonStartHost").GetComponent<Button> ().onClick.RemoveAllListeners ();
		GameObject.Find ("ButtonStartHost").GetComponent<Button> ().onClick.AddListener (StartupHost);

		GameObject.Find ("ButtonJoinGame").GetComponent<Button> ().onClick.RemoveAllListeners ();
		GameObject.Find ("ButtonJoinGame").GetComponent<Button> ().onClick.AddListener (JoinGame);
	}

	void SetupOtherSceneButtons(){
		GameObject.Find ("ButtonDisconnect").GetComponent<Button> ().onClick.RemoveAllListeners ();
		GameObject.Find ("ButtonDisconnect").GetComponent<Button> ().onClick.AddListener (NetworkManager.singleton.StopHost);
	}

I get a message saying that OnLevelWasLoaded is deprecated. Also, when I run the game, My buttons aren’t doing anything.

I think it may have something to do with OnLevelWasLoaded, but then what should I do??

Thanks so much!

Unity has switched to SceneManager to handle its scenes. you should find what you need here: Unity - Scripting API: SceneManager