Exemple #1
0
 // 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;
 }
Exemple #2
0
    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;
        }
    }
Exemple #3
0
    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);
    }