// Start is called before the first frame update void Start() { _gm = GameObject.Find("Game Manager").GetComponent <GameManagerX4>(); _sm = GameObject.Find("Spawn Manager").GetComponent <SpawnManagerX4>(); enemyRb = GetComponent <Rigidbody>(); playerGoal = GameObject.Find("Player Goal"); _levelSpawn = _gm.level; }
public IEnumerator StartCountdown() { _gm = GameObject.Find("Game Manager").GetComponent <GameManagerX4>(); while (!_gm.isGameOver)// && timeRemaining > 0) { yield return(new WaitForSeconds(1.0f)); timeRemaining--; _timeText.text = "Time: " + timeRemaining; } }
private void Start() { _gm = GameObject.Find("Game Manager").GetComponent <GameManagerX4>(); enemyCount = GameObject.FindGameObjectsWithTag("Enemy").Length; _timePrevious = timeRemaining; _timeText.text = "Time: " + timeRemaining; StartCoroutine(StartCountdown()); SpawnEnemyWave(waveCount); }