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

public class LevelPreviewController : MonoBehaviour {

    public Sprite[] listBackgrounds, listMoves, listTargets;
    public Image moves, targets, backgrounds;

    private int m_currentLevel;

    private void Awake() {
        //m_movesText = GameObject.Find("MovesText").GetComponent<Text>();
        //m_targetsText = GameObject.Find("TargetsText").GetComponent<Text>();
    }

    // Use this for initialization
    void Start () {
        //StartCoroutine(SceneTransitionManager.fadeOut());
        //m_movesText.text = "Moves: " + PlayerPrefs.GetInt("moves");
        //m_targetsText.text = "Targets: " + PlayerPrefs.GetInt("targets");
        m_currentLevel = PlayerPrefs.HasKey("currentLevel") ? PlayerPrefs.GetInt("currentLevel") - 1 : 0;
        moves.sprite = listMoves[m_currentLevel];
        targets.sprite = listTargets[m_currentLevel];
        backgrounds.sprite = listBackgrounds[m_currentLevel];
    }
	
    public void goBack() {
        SceneManager.LoadScene("level_menu");
    }

    public void startLevel() {
        SceneManager.LoadScene("level");
    }
}
