0
我有这段代码当按下内置的索引顺序(例如,场景a是数字0,场景b是数字1和数字)时,转到下一个场景。 ..),但它不起作用。去建立的索引顺序中的下一个场景
void Update() {
if (Input.GetKey (KeyCode.Space)) {
int nextSceneIndex = SceneManager.GetActiveScene().buildIndex + 1;
SceneManager.LoadScene (nextSceneIndex);
}
}
你有错误吗?它是否改变为错误的场景?它是否改变场景? “SceneManager.LoadScene”里面的代码是什么?多一点细节可以帮助你。 – Agustin0987