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); }
public void cargar() { scr_nivel n_ = GetComponent <f_archivos> ().leer_archivo(); n_editable.points = n_.points; iniciar(); print("fin iniciado"); }
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); }
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"); }
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; }