using UnityEngine;
using System.Collections;

public class collisionGemme : MonoBehaviour {
	public GameObject porteBas;
	public GameObject porteHaut;
	bool touche = false;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update() {
		if(touche)
		{
			porteHaut.transform.Translate(Vector3.back*Time.deltaTime*3);
			porteBas.transform.Translate(Vector3.back*Time.deltaTime*3);
			Destroy(gameObject.collider);
		}
	}
	void OnCollisionEnter(Collision collision){
		Debug.Log(collision.collider.tag);
		if(collision.collider.tag == "bullets"){
			Debug.Log("touche serrure");
			touche = true;
		}
	}
}
