public void ReGame() { StartCoroutine("Loding"); // 도로에 생성되어 있는 오브젝트들 전부 삭제 objects = GameObject.FindGameObjectsWithTag("Road"); for (int i = 0; i < objects.Length; i++) { Destroy(objects[i]); } objects = GameObject.FindGameObjectsWithTag("TrainRoad"); for (int i = 0; i < objects.Length; i++) { Destroy(objects[i]); } // 플레이어 원위치 후 다시 시작 player.Start(); // 다시 시작할 때 앞에 20칸은 생성하기(앞에 도로가 바로 보이도록) Start(); }