Beispiel #1
0
 public void OnEventRaised(DeathType deathType)
 {
     if (this.useDeathTypeAsMessage)
     {
         this.message = deathType.ToString();
     }
     this.SendMessage();
 }
Beispiel #2
0
    private void Death(DeathType type)
    {
        died = true;

        switch (type)
        {
        case (DeathType.Explode):
            anim.SetExplode();
            Debug.Log("Exploded!");
            break;

        case (DeathType.Impale):
            anim.SetImpaled();
            Debug.Log("Impaled");
            break;

        case (DeathType.Hang):
            anim.SetHang_Death();
            DoHang();
            break;

        case (DeathType.Electricuted):
            anim.SetElectricuted();
            break;

        case (DeathType.Tripped):
            anim.SetTrip();
            break;

        case (DeathType.Spider):
            anim.SetSpider();
            break;

        default:
            Debug.Log("Exploded!");
            break;
        }
        Debug.Log(string.Format("Player died because of {0}", type.ToString()));
    }