单击 JavaScript 如何更改场景? (Unity5)

How do I change scenes with JavaScript on click? (Unity5)

我只是想知道如何在Javascript中点击鼠标切换到不同的场景。 'Application.LoadLevel' 显然现在已经过时了。 请尽可能简单的脚本,因为我真的无法掌握高级的东西,而且它们通常会出现某种我不得不询问的错误。

文档很好地介绍了这一点。

http://docs.unity3d.com/ScriptReference/Application.LoadLevel.html

Use SceneManager.LoadScene

在javaScript中,有点间接但不难

//first you need to declare the class file for SceneManager

var ls:UnityEngine.SceneManagement.SceneManager;

//then after declaring this, you can use the LoadScene function

function Start () {

         ls.LoadScene("menu"); 
}