Пример #1
0
 void explodir()
 {
     Instantiate(preFabExplosao, transform.position, transform.rotation);
     script_GC.morreu();
     Destroy(this.gameObject);
     StartCoroutine("vuneravel");
 }
Пример #2
0
    void explodir()
    {
        //para instanciar o prefab sem manipular configuracoes, linha abaixo
        //Instantiate(explosaoPrefab, transform.position, Quaternion.identity);
        GameObject tempPrefab = Instantiate(explosaoPrefab) as GameObject;

        tempPrefab.transform.position = transform.position;
        _GC.morreu();
        Destroy(this.gameObject);
    }