-1
我使用統一5.5.03f,我想重新加載一個屏幕,一旦人物遇到障礙物,我的箱子碰撞裝置會連接到兩者。但是我擁有的代碼無法工作。加載一個級別統一5.5.0f3
這是我對重新啓動屏幕的代碼:我使用C#作爲我的編程語言,統一
using UnityEngine.SceneManagement;
.
.
.
void onCollisionEnter2D(Collision2D collision){
// get the current scene name
string sceneName = SceneManager.GetActiveScene().name;
// load the same scene
SceneManager.LoadScene(sceneName, LoadSceneMode.Single);
}
。 任何幫助和建議將不勝感激。
哦,我看到現在,太感謝你了,我真的很感激 –