📜  Unity 中的更改级别 - C# 代码示例

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

代码示例2
public UnityEngine.UI.InputField sceneInputField; //Refence to your inputField

public void ChangeSceneBasedOnInputField() //Code that needs to be called
 {
      UnityEngine.SceneManagement.SceneManager.LoadScene(sceneInputField.text);  
     //This way you can type either the index of the scene or it's name
     //Will throw an error if it can`t find the scene
}