using UnityEngine;
using System.Collections;

public class DestroyWithTrigger : MonoBehaviour 
{
	[Range(0,1)]
	public float destroyTime;

	void OnTriggerExit2D(Collider2D other)
	{
		if (other.gameObject.tag == "Player") 
		{
			Destroy(gameObject,destroyTime);
		}
	}
}
