public void Guardar(string Nombre) { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(ruta); datosGuardar datos = new datosGuardar(); switch (Nombre) { case "Andrea": datos.puntuacionMaxAndrea = _puntuacionMaxima; bf.Serialize(file, datos); file.Close(); break; } }
public void Cargar(string Nombre) { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Open(ruta, FileMode.Open); datosGuardar datos = (datosGuardar)bf.Deserialize(file); switch (Nombre) { case "Andrea": //_puntuacionMaxima = datos.puntuacionMaxAndrea; Debug.Log("Los datos cargados son :" + datos.puntuacionMaxAndrea); break; } file.Close(); }