void Awake() { anim = GetComponentInChildren <Animator>(); enemyAudio = GetComponent <AudioSource>(); //hitParticles = GetComponentInChildren<ParticleSystem>(); capsuleCollider = GetComponent <CapsuleCollider>(); enemyAI = GetComponent <EnemyAI>(); currentHealth = startingHealth; PopUpTextContollerScript.Initialize(); }
public void TakeDamage(int amount /*, Vector3 hitPoint*/) { if (isDead) { return; } else { enemyAudio.Play(); currentHealth -= amount; PopUpTextContollerScript.CreateFloatingText(amount.ToString(), transform); if (currentHealth <= 0) { Death(); } } }