using UnityEngine;
using System.Collections;

public class DestroyUICrown : MonoBehaviour {

    public bool isDestroyed;


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

    void OnTriggerEnter2D(Collider2D col)
    {
        if(col.gameObject.tag == "Player")
        {
            if(!isDestroyed)
            {
                Destroy(transform.GetChild(0).gameObject);
            }
        }
    }

}
