using UnityEngine;
using System.Collections;

public class AssignmentBehaviour : MonoBehaviour {
	
	// Use this for initialization
	void Start () 
	{
		
	}
	
	// Update is called once per frame
	void Update () 
	{

	}
	
	void OnTriggerEnter(Collider coll)
	{
		if(coll.gameObject.GetComponent<Hero>()!=null)
		{
			if(!GameObject.FindGameObjectWithTag("SafeZone").GetComponent<SafeZoneBehaviour>().m_HeroHasAssignment)
			{
				GameObject.FindGameObjectWithTag("SafeZone").GetComponent<SafeZoneBehaviour>().HeroTakesAssignemnt();
				Destroy(gameObject);
				GameObject.Find("Radio").GetComponent<Radio>().Bonus();
			}
		}
	}
}
