using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Door : MonoBehaviour {
	public Animator anim;
	// Use this for initialization
	void Start () {
		anim = GetComponent<Animator> ();
	}
	
	// Update is called once per frame
	void Update () {
		
	}
	public void OpenDoor()
	{
		anim.Play ("Door Animation");
		GetComponent<BoxCollider2D> ().enabled = false;
		Invoke ("CloseDoor", 4f);
	}
	public void CloseDoor()
	{
		anim.Play ("Closing Animation");
		GetComponent<BoxCollider2D> ().enabled = true;
	}
}
