// Use this for initialization void Start() { gameController = GameObject.FindWithTag("GameController").GetComponent <GameController>(); enemyController = GetComponent <EnemyController>(); moneyController = GameObject.FindWithTag("Money UI").GetComponent <MoneyController>(); healthBar = transform.GetChild(1).GetChild(0).GetComponent <EnemyHealthBar>(); waveCounterUI = GameObject.FindWithTag("Wave Counter UI").GetComponent <WaveCounterUI>(); health = 100; }
// Use this for initialization void Start() { // Lock the cursor to the center of the screen and hide it. Cursor.lockState = CursorLockMode.Locked; waveCounterUI = GameObject.FindWithTag("Wave Counter UI").GetComponent <WaveCounterUI>(); moneyController = GameObject.FindWithTag("Money UI").GetComponent <MoneyController>(); currEnemyWaveHp = initEnemyWaveHp; remainingCurrEnemyWaveHp = currEnemyWaveHp; money = 800; moneyController.setMoneyText(money); waveNum = 1; waveCounterUI.setWaveCounter(waveNum, currEnemyWaveHp, currEnemyWaveHp); waveInProgress = true; uiDisableMouseLook = false; uiDisableMouseLook = false; StartCoroutine(SpawnWave()); StartCoroutine(WaveController()); }