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

public class EnderTrigger : MonoBehaviour {

    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.name != "player") return;
        GameObject.Find("QuestTracker").GetComponent<QuestTrackerScript>().End();
        GameObject player = GameObject.Find("player");
        PlayerScript ps = player.GetComponent<PlayerScript>();
        ps.dontReload = true;
        Progress.MarkAsDefeated(SceneManager.GetActiveScene().name, ps.points);
        SceneManager.LoadScene("overworld");
    }

}
