using UnityEngine;
using System.Collections;

public class Beam : MonoBehaviour {
	
	public GameObject plan;
	//public GameObject Depart;
	//public GameObject Arrivee;
	
	void OnTriggerEnter(Collider other){
		
	Debug.Log(other.gameObject.layer);
		
		
		if(other.gameObject.layer!=22){
		
			Destroy(other.gameObject);
			Debug.Log("PERDU !");
			plan.collider.isTrigger=true;
		}
		
		
		
		/*
		Debug.Log(other.gameObject.layer);
		Destroy(other.gameObject);
		/*
        foreach (ContactPoint contact in collisionInfo.contacts) {
            Debug.DrawRay(contact.point, contact.normal * 10, Color.white);
        }
		*/
		
	}
	
}
