private void OnTriggerEnter2D(Collider2D collision) { if (collision.GetComponent <PlayerBehavior>() != null) { float totalRoomCompletion = 0; foreach (RoomEndButton room in rooms) { totalRoomCompletion += room.percentageComplete; } floorCompletion = totalRoomCompletion / rooms.Count; winScreen.InputScore(floorCompletion); SceneManager.LoadScene(nextFloor); } }