using UnityEngine;
using System.Collections;

public class BurningArea : MonoBehaviour {

	void Start()
	{
		if (transform.parent.tag != "A") 
			 gameObject.SetActive (false);
	}

	void OnTriggerStay(Collider other)
	{
		if (other.gameObject.tag == "B") 
		{
			if(other.gameObject.GetComponent<PlayerB>() == null) return;
			other.gameObject.GetComponent<PlayerB>().Brucia();
		}

		if (other.gameObject.tag == "burnable") 
		{
			if(other.gameObject.GetComponent<Burnable>() == null)
			{		
				return;
			}
			Burnable b = other.gameObject.GetComponent<Burnable>();
			//print(other.gameObject.GetComponent<Burnable>().name);
			b.Brucia();

		}
	}
}
