void Havedamage(float dmg) { health -= dmg; if (health <= 0.0f) { this.gameObject.SetActive(false); if (this.gameObject.layer == LayerMask.NameToLayer("Enemys")) { eSquad.UnitDestroy(this.gameObject, type); } EffectManager.Instance.GetEffect(this.transform.position, 1); } }