Beispiel #1
0
    public virtual void Destroy()
    {
        gameObject.SetActive(false);
        GameObject deathEffect = Instantiate(deathFX, transform.position, Quaternion.identity);
        GameObject droppedItem = newItem.GetRandomItem();

        if (droppedItem != null)
        {
            Instantiate(droppedItem, transform.position, Quaternion.identity);
        }
        Destroy(deathEffect, 1f);
    }
Beispiel #2
0
    public void Destroy()
    {
        anim.SetBool("Destroyed", true);
        Invoke("Disable", 2f);

        if (contents != null)
        {
            SpawnItem(contents);
        }
        else
        {
            GameObject droppedItem = newItem.GetRandomItem();
            if (droppedItem != null)
            {
                SpawnItem(droppedItem);
            }
        }
    }