public void GenerateLevel() { if (seed != "") { RandomUtility.Initialize(seed); } else { RandomUtility.Initialize(Random.ColorHSV()); } level.Generate(); }
public void StartGame() { RandomUtility.Initialize(Random.rotation); StartCoordinates startCoords = level.Generate(); PortalPosition = startCoords.playerPosition; player = Instantiate <Player> (_playerPrefab, PortalPosition, Quaternion.identity); Portal = Instantiate(_portalPrefab, PortalPosition, Quaternion.identity); rescuee = Instantiate(rescueePrefab, startCoords.rescueePosition, Quaternion.identity); enemyController.Initialize(startCoords.enemyPositions, player.transform); walkableMap = startCoords.walkableMap; Pathfinder.Create(walkableMap, (Vector2)level.grid.cellSize); _playerUI.gameObject.SetActive(true); _startMenu.SetActive(false); }