void OnGui()
{
GUI.Box(new Rect(30, 30, 150, 100), "Loader Menu");
// Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
if (GUI.Button(new Rect(20, 40, 80, 20), "Level 1"))
{
SceneManager.LoadScene(1);
}
// Make the second button.
if (GUI.Button(new Rect(20, 70, 80, 20), "Level 2"))
{
SceneManager.LoadScene(2);
}
}
上面代码带入编译显示已过期
{
GUI.Box(new Rect(30, 30, 150, 100), "Loader Menu");
// Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
if (GUI.Button(new Rect(20, 40, 80, 20), "Level 1"))
{
SceneManager.LoadScene(1);
}
// Make the second button.
if (GUI.Button(new Rect(20, 70, 80, 20), "Level 2"))
{
SceneManager.LoadScene(2);
}
}
上面代码带入编译显示已过期
