摘自:http://www.heyclock.com/archives/708
随着unity的不断更新,你是否发现之前的场景加载“Application.LoadLevel”已经过时了呢,下面我们来介绍信的场景加载的用法。
1
2
3
4
5
6
7
8
|
using
UnityEngine.SceneManagement;
//头部引入
//在你想跳转场景的地方加入下面代码
SceneManager.LoadScene(sceneName);
//括号内加入场景名字
//另一种写法
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
|
好了,分享就到这里了,有什么不对的地方欢迎大家留言指正。