using UnityEngine;
using System.Collections;

public class Meta : MonoBehaviour {

    public Transform fireworksPrefab;

    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "Player")
            GanarJuego();
    }

    private void GanarJuego()
    {
        var fireworks = Instantiate(fireworksPrefab).GetComponent<Transform>();
        fireworks.position = transform.GetChild(0).position;
        Nivel.current.protagonista.GetComponent<UnityStandardAssets._2D.Platformer2DUserControl>().StopInput();
        Destroy(Cromometro.current.gameObject);
    }
}
