// Start is called before the first frame update void Start() { Health = MaxHealth; rb = GetComponent <Rigidbody2D>(); scorer = FindObjectOfType <ScorePlayers>(); OnDie.AddListener(() => scorer.EnemyKill(this)); }
public void Die() { //LastDamagedBy.KillEnemy(); if (GetComponent <Smash>()) { GetComponent <Smash>().DoSmash(); } else { Destroy(this.gameObject); scorer.EnemyKill(this); } OnDie.Invoke(); }