public void DealDamage(int damage) { health -= damage; GameplayController.instance.PlayerLifeCounter(health); anim.HurtAnimation(); if (health <= 0) { GameplayController.instance.playerAlive = false; GetComponent <Collider2D>().enabled = false; anim.DeadAnimation(); bloodFX[Random.Range(0, bloodFX.Length)].SetActive(true); } }