public void ProcessNextRoom() { _currentRoomIndex++; if (_currentRoom != null) { Destroy(_currentRoom); foreach (Transform child in AppModel.DropManager().GetDropped()) { Destroy(child.gameObject); } } var nextRoom = predefinedRooms[_currentRoomIndex]; _currentRoom = Instantiate(nextRoom); _currentRoom.AddComponent <StraightRoomController>(); AppModel.PlayerTransform().position = _currentRoom.transform.Find("StartPoint").position; }
void Start() { _player = AppModel.PlayerTransform(); }