📜  loadscene unity - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:04.311000             🧑  作者: Mango

代码示例4
using UnityEngine;
using UnityEngine.SceneManagement;

public class Singleplayer : MonoBehaviour
{
    public void LoadNextLevel()
    {
        //This will load the next scene in the buildIndex, e.g if in scene 3, go to scene 4
        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex +1);
    }
}