예제 #1
0
    public void OnClick_CargarPartida(int n)
    {
        string path = Application.persistentDataPath + "/juego" + n + ".chernobyl";

        if (File.Exists(path) == false)
        {
            PanelMensaje.SetActive(true);
            TextMeshProUGUI txtMensaje = PanelMensaje.transform.Find("Mensaje").GetComponentInChildren <TextMeshProUGUI>();
            txtMensaje.text = "Partida vacia. Porfavor selecciona otra partida";
        }
        else
        {
            nPartida = n;
            SceneManager.LoadScene(nombreNivel1);
        }
    }
예제 #2
0
    public void NuevaPartida(string nombreNivel1)
    {
        int nuevoN = BuscarPartidaVacia();

        if (nuevoN < maxNPartidas)
        {
            nPartida = nuevoN;
            Partidas[nPartida].GetComponentInChildren <TextMeshProUGUI>().text = "Usado";
            SceneManager.LoadScene(nombreNivel1);
        }
        else
        {
            PanelMensaje.SetActive(true);
            TextMeshProUGUI txtMensaje = PanelMensaje.transform.Find("Mensaje").GetComponentInChildren <TextMeshProUGUI>();
            txtMensaje.text = "Todas las partidas estan usadas. Selecciona 'Cargar Partida'";
        }
    }
예제 #3
0
 public void OnClick_Ok_PanelMensaje()
 {
     PanelMensaje.SetActive(false);
 }
예제 #4
0
 private void Start()
 {
     PanelMensaje.SetActive(false);
     PanelBorrar.SetActive(false);
     ActualizarTextoPartidas();
 }