Example #1
0
    public void gotHit()
    {
        exploded = true;     // 1
        ItemSpawner itemSpawner = FindObjectOfType <ItemSpawner>();

        itemSpawner.BoxDestroyed(this); //2
        Destroy(gameObject);            // 3
    }