Beispiel #1
0
 public void Die()
 {
     if (dieEffect != null)
     {
         var effect = Instantiate(dieEffect);
         effect.transform.position = transform.position;
     }
     lootDropper.DropLoot();
     Destroy(gameObject);
 }
    private void Die()
    {
        animator.SetBool("isRunning", false);
        animator.SetTrigger("Death");
        sfxc.playDeathSound();

        isDead = true;

        if (gameObject.CompareTag("Player"))
        {
            gfc.OnGameOver();
        }
        else if (gameObject.CompareTag("Boss"))
        {
            gfc.OnGameOver();
        }
        else
        {
            dropper.DropLoot();
        }

        StartCoroutine(DeleteObject(3));
    }
Beispiel #3
0
 public void Die()
 {
     lootDropper.DropLoot();
     Destroy(gameObject);
 }