guinunez

DestruirAlContacto.cs

Jul 6th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class DestruirAlContacto : MonoBehaviour {
  6.  
  7.     public GameObject explosion;
  8.  
  9.     void OnTriggerEnter2D(Collider2D colision) {
  10.         if (colision.tag == "Frontera") {
  11.             return;
  12.         }
  13.  
  14.         Instantiate (explosion, transform.position, transform.rotation);
  15.         Destroy(colision.gameObject);
  16.         Destroy(gameObject);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment