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

public class BoxScript : MonoBehaviour {

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

	void OnCollisionEnter2D(Collision2D col) {
        GetComponent<AudioSource>().Play();
        GetComponent<BoxCollider2D>().enabled = false;
        LeanTween.alpha(gameObject, 0, 0.75f).setOnComplete(AnimationDone);
	}

    public void AnimationDone() {
        Destroy(gameObject);
    }

}
