void Die() { // I am dying for some reason. DeathEvent dei = new DeathEvent(); dei.Description = "Unit " + this.Name + " has died."; dei.target = (Node2D)GetParent(); dei.FireEvent(); GetParent().QueueFree(); }
public void CheckHealth() { if (GetComponent <Stats>().health.Value - damage <= 0) { DeathEvent deathEventInfo = new DeathEvent(); deathEventInfo.baseGO = gameObject; deathEventInfo.FireEvent(); } //Send the callback event for the amount of health }
void Die() { DeathEvent deathEvent = new DeathEvent(this.gameObject, deathSound, deathParticle); deathEvent.FireEvent(); }