using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class PopUpFX : MonoBehaviour 
{
	public Text popUpTxt;				
	public string value;	
	public GameObject item;
	public GameObject itemFx;
	public Collider2D coll;


	void Start()
	{
		coll = GetComponent<Collider2D>();
	}


	void OnTriggerEnter2D(Collider2D other) 
	{
		if (other.gameObject.tag == "Player") 
		{
			Instantiate(itemFx,transform.position,transform.rotation);   
			popUpTxt.text = value;
			item.SetActive(false);
		}
	}

	void OnTriggerExit2D(Collider2D other)
	{
		if (other.gameObject.tag == "Player") 
		{
			coll.enabled = false;
		}
	}

}





