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

public class mostrarEscenaRanking : MonoBehaviour {
    
    public Text ranking;
    public GameObject papiro;

    public string textRang;
    

    void OnMouseDown()
    {
        ranking.enabled = true;
        papiro.SetActive(true);

        Debug.Log("pulsado boton ranking");

        textRang = "";
        
        for (int i = 0; i < 5; i++)
        {
            // ranking.text += (i + 1) + " " + PlayerPrefs.GetString("rangName" + i) + "  " + PlayerPrefs.GetInt("score" + i) + "\n";
            textRang += (i + 1) + " " + PlayerPrefs.GetString("rangName" + i) + "  " + PlayerPrefs.GetInt("score" + i) + "\n";
        }

        //asociamos a la variable que contiene la cadena con el ranking a la variable que contiene el texto que aparece en el pergamino.
        ranking.text = textRang;
    }
}
