Advertisement
Guest User

Projetil

a guest
Feb 21st, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Bola : MonoBehaviour {
  5.  
  6. public GameObject explosao;
  7.  
  8. public Vector3 posicao;
  9. // Use this for initialization
  10. void OnTriggerEnter2D(Collider2D coll){
  11. if(coll.tag == "inimigo"){
  12. Destroy (coll.gameObject);
  13. Instantiate (explosao,posicao,Quaternion.identity);
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement