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

public class DoorScript : MonoBehaviour {

    bool dying = false;
    float timer;

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {

        if (dying)
        {
            timer -= Time.deltaTime;
            Vector3 v = new Vector3(timer * .47f / .95f, timer, 1);
            this.transform.localScale = v;
            if (timer < 0) Destroy(gameObject);
        }
    }

    public void TriggerDoor()
    {
        timer = 1f;
        dying = true;
    }
}
