Exemple #1
0
    public void escribir_archivo(scr_nivel file_)
    {
        string file_path   = Application.dataPath + "/editable/nivel.json";
        string json_string = JsonUtility.ToJson(file_);

        File.WriteAllText(file_path, json_string);
    }
Exemple #2
0
    public void cargar()
    {
        scr_nivel n_ = GetComponent <f_archivos> ().leer_archivo();

        n_editable.points = n_.points;
        iniciar();
        print("fin iniciado");
    }
Exemple #3
0
    public scr_nivel leer_archivo()
    {
        string    file_path   = Application.dataPath + "/editable/nivel.json";
        string    json_string = File.ReadAllText(file_path);
        scr_nivel nivel       = JsonUtility.FromJson <scr_nivel> (json_string);

        //print ("a");
        return(nivel);
    }
Exemple #4
0
    public void guardar()
    {
        //se guardara en un archivo json
        scr_nivel n_ = new scr_nivel();

        n_.points = n_editable.points;
        GetComponent <f_archivos> ().escribir_archivo(n_);
        print("fin guardado");
    }
Exemple #5
0
    public void iniciar_juego()
    {
        on_play = true;
        scr_nivel n_ = GetComponent <f_archivos> ().leer_archivo();

        points        = n_.points;
        t_total.text  = points.Count.ToString();
        t_actual.text = points.Count.ToString();
        p_actual      = points.Count;
        p_total       = points.Count;
        p_t_actual    = 0;
        p_time_barra  = 0;
        points        = n_.points;
    }