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

public class PickupBoxScript : MonoBehaviour {

    // Use this for initialization
    private void OnTriggerEnter2D(Collider2D collision)
    {
        GetComponent<AudioSource>().Play();
        GetComponent<BoxCollider2D>().enabled = false;
        LeanTween.rotate(gameObject, new Vector3(0, 0, 180), 0.25f).setOnComplete(AnimationDone);
    }

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