public void load_idiomasetup() { if (File.Exists(Application.persistentDataPath + "/" + juego + savefile + "idiomasetup07.dat")) { BinaryFormatter bf = new BinaryFormatter(); FileStream my_file = File.Open(Application.persistentDataPath + "/" + juego + savefile + "idiomasetup07.dat", FileMode.Open); IdiomaData my_data = (IdiomaData)bf.Deserialize(my_file); idioma = my_data.idioma; languageselected = my_data.languageselected; my_file.Close(); Debug.Log("datos idioma cargadas"); } else { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(Application.persistentDataPath + "/" + juego + savefile + "idiomasetup07.dat"); IdiomaData data = new IdiomaData(); data.idioma = idioma; data.languageselected = languageselected; bf.Serialize(file, data); file.Close(); Debug.Log("datos idioma guardadas"); } }
public void save_idiomasetup() { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(Application.persistentDataPath + "/" + juego + savefile + "idiomasetup07.dat"); IdiomaData data = new IdiomaData(); data.idioma = idioma; data.languageselected = languageselected; bf.Serialize(file, data); file.Close(); Debug.Log("datos idioma guardadas"); }
public void Reset_playerdata(Dictionary <int, mision_data> _catalogo_misiones, Dictionary <int, inventario_data> _catalogo_inventario, Dictionary <int, mision_orbes_data> _catalogo_orbes_misiones, string _savefile) { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(Application.persistentDataPath + "/" + juego + _savefile + "094.dat"); PlayerData data = new PlayerData(); data.puntos = puntos; data.currentarmor = 0; data.currentespecial = 0; data.armorunlocked = 0; data.espunlocked = 0; data.historiainicialoida = 0; data.catalogo_misiones = _catalogo_misiones; data.catalogo_inventario = _catalogo_inventario; data.catalogo_skills = catalogo_skills; bf.Serialize(file, data); file.Close(); Debug.Log("datos player guardadas"); BinaryFormatter bf2 = new BinaryFormatter(); FileStream file2 = File.Create(Application.persistentDataPath + "/" + juego + _savefile + "especialdata.dat"); EspData data2 = new EspData(); data2.bossrushcelared = 0; data2.gamecleared = 0; bf2.Serialize(file2, data2); file2.Close(); Debug.Log("datos especial guardadas"); BinaryFormatter bf3 = new BinaryFormatter(); FileStream file3 = File.Create(Application.persistentDataPath + "/" + juego + _savefile + "expdata0911.dat"); experiencedata data3 = new experiencedata(); data3.base_nivel = 1; data3.experience = 0; data3.fuerza = 1; data3.speed = 1; data3.defensa = 1; data3.autocura = 0; data3.autopotion = 0; data3.skillpoints = 0; bf3.Serialize(file3, data3); file3.Close(); Debug.Log("exp datos guardadas"); BinaryFormatter bf4 = new BinaryFormatter(); FileStream file4 = File.Create(Application.persistentDataPath + "/" + juego + savefile + "idiomasetup07.dat"); IdiomaData data4 = new IdiomaData(); data4.idioma = idioma; data4.languageselected = languageselected; bf4.Serialize(file4, data4); file4.Close(); Debug.Log("datos idioma guardadas"); BinaryFormatter bf5 = new BinaryFormatter(); FileStream file5 = File.Create(Application.persistentDataPath + "/" + juego + savefile + "orbes03.dat"); main_orbes_data data5 = new main_orbes_data(); data5.catalogo_orbes_misiones = _catalogo_orbes_misiones; bf5.Serialize(file5, data5); file5.Close(); Debug.Log("datos orbes guardadas"); }