﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ExplosionDestroy : MonoBehaviour {

	public bool Destroyer = true;

	public float DetonateTime = 0.30f;
	// Use this for initialization
	void OnCollisionEnter(Collision TheContact){

		if (TheContact.gameObject.CompareTag("BuildingWall") && Destroyer == true) {
			Destroy (TheContact.gameObject);
		}
	}

	void Update () {
		if (DetonateTime > 0) {
			DetonateTime -= Time.deltaTime;
		}else{
			Destroy(this.gameObject);
		}
	}
}
