Example #1
0
    // instantiates graphic explosion, destroys bomb, decrement health
    void Explode()
    {
        GameObject explosion = Resources.Load("GraphicExplosion") as GameObject;

        Instantiate(explosion, transform.position, Quaternion.Euler(0, 0, 0));
        Destroy(this.gameObject);
        bg.FreeRegion(region); // tell bomb generator that region is now free
        gm.DecreaseHealth();
    }