using ScrambleKit.Game;
using ScrambleKit.Hits;
using UnityEngine;
using UnityEngine.SceneManagement;

public class SaveProgressOnExit : MonoBehaviour 
{
    public string SceneToLoad;

    public void OnCollisionEnter2D(Collision2D col)
    {
        if (col.gameObject.tag == "Player")
        {
            GameProgress.HPFromlastScene = GameInfo.Player.GetComponent<HitPoints>().HP;
            Debug.Log("Saving HP Progress as " + GameProgress.HPFromlastScene);
            SceneManager.LoadScene(SceneToLoad);
        }
    }
}
