using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

public class TrapExit : MonoBehaviour {

	GameObject oth;
	public GameObject fire;

	void OnTriggerEnter2D(Collider2D other) {
		if (other.tag.Equals ("Player")) {
			oth = other.gameObject;
			Invoke ("trapTouch", 1.5f);
			fire.SetActive(true);

			//SceneManager.LoadScene (SceneManager.GetActiveScene().name);
		}
	}

	void trapTouch()
	{
		
		oth.GetComponent<Collider2D> ().attachedRigidbody.isKinematic = true;
		oth.GetComponent<AllCharMovement> ().enabled = false;
		Application.Quit ();
		Debug.Break ();
	}
}
