// Controls the rate of flashing for an enemy private void FlashUnitRegularily() { if (timeBetweenFlashes > 0.0f) { if (lastFlash <= 0.0f) { flashController.Flash(); lastFlash = timeBetweenFlashes; } else { lastFlash -= Time.deltaTime; } } }
private void FlashBoss() { if (lastFlashTime <= 0.0f) { myColorFlash.Flash(); lastFlashTime = timeBetweenFlashes; } else { lastFlashTime -= Time.deltaTime; } }
public void DamagePlayer(int damage) { if (isDead || invincibilityCounter > 0) { return; } health -= damage; invincibilityCounter = invincibilityTime; flashController.Flash(); UpdateScore(-200); // play the sound for the player being hit guiManager.UpdateHealthDisplay(health, maxHealth); if (health <= 0) { KillPlayer(); } }