Advertisement
JonneOpettaja

Bomb.cs

Mar 7th, 2019
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Bomb : MonoBehaviour {
  6.  
  7.     public GameObject explosionPrefab;
  8.  
  9.     private void OnTriggerEnter2D(Collider2D collision)
  10.     {
  11.         Destroy(collision.gameObject);
  12.         GameObject.Instantiate(explosionPrefab, transform.position, transform.rotation);
  13.         Destroy(gameObject);
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement