private void CheckAttackTimer() { timer += Time.deltaTime; if (_currentEvent == Events.READY_TO_ATTACK && Gamesystem.gameState == GameState.IN_WAVE) { if (timer > _offensiveComp.cooldown) { _offensiveComp.SearchAndAttack(); timer = 0; } } }
void Update() { timer += Time.deltaTime; if (Gamesystem.gameState == GameState.IN_WAVE) { if (timer > _offensiveComp.cooldown) { if (_offensiveComp.SearchAndAttack()) { _animatorComp.SetBool(BOOL_SHOOT, true); } timer = 0; } } }