public void Init(int i, ref Vector3 _pos, ref Vector3 _rota) { obstacleSpawner = this.gameObject.GetComponent <ObstacleSpawner>(); obstacleSpawner.Init(); Spawn(i, ref _pos, ref _rota); }
void Start() { if (PlayerPrefs.GetInt("level") == null) { PlayerPrefs.SetInt("level", 0); } level = PlayerPrefs.GetInt("level"); _secondsBetweenSpawns = _secondsBetweenSpawnsList[level]; _obstacleSpeed = _obstacleSpeedList[level]; Ship.Instance.spinningSpeed = _spinSpeedList[level]; Speedometer.Instance.ShowSpeed(level); _timeRemaining = 10f; _canSpawn = true; _hasSwitchedLevels = false; _leftLeft.Init(this, _obstaclePrefab, _obstacleSpeed); _leftRight.Init(this, _obstaclePrefab, _obstacleSpeed); _rightLeft.Init(this, _obstaclePrefab, _obstacleSpeed); _rightRight.Init(this, _obstaclePrefab, _obstacleSpeed); StartCoroutine(SpawnRandomScenario()); }
private void Init() { obstacleSpawner.Init(); background.Init(); uiHolder.Init(); }