Esempio n. 1
0
    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();
    }
Esempio n. 2
0
 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();
    }