private void SpawnUpsideDown(LevelObject l) { if (_upsidedownlevelindex >= l.GetLevel().Count) { _upsidedownlevelindex = 0; _down = _levelbook.BuildRandomLevel(30, 5); builddown(); } foreach (float f in l.GetLevel()[_upsidedownlevelindex]) { var obstacle = f == 0f ? Instantiate(FloorObstaclePrefab, new Vector3(12, f, 0), Quaternion.identity) : Instantiate(ObstaclePrefab, new Vector3(12, -f, 0), Quaternion.identity); obstacle.GetComponent <ObstacleHandler>().Spawn = this; LiveObstacles.Add(obstacle); } _upsidedownlevelindex++; }
private void Spawn(LevelObject l) { if (_levelindex >= l.GetLevel().Count) { Tutorial = false; _levelindex = 0; buildup(); } foreach (float f in l.GetLevel()[_levelindex]) { var obstacle = f == 0f ? Instantiate(FloorObstaclePrefab, new Vector3(12, f, 0), Quaternion.identity) : Instantiate(ObstaclePrefab, new Vector3(12, f, 0), Quaternion.identity); obstacle.GetComponent <ObstacleHandler>().Spawn = this; LiveObstacles.Add(obstacle); } _levelindex++; }