private void LoadSaveThree() { if (File.Exists(Application.persistentDataPath + "/shot3.save")) { ShotData3 shotdata = SaveSystemShot3.LoadShots(); EquippedShots = shotdata.Shots3; } }
public static void SaveShots3(SpecialShots shot3) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/shot3.save"; FileStream stream = new FileStream(path, FileMode.Create); ShotData3 datashot = new ShotData3(shot3); formatter.Serialize(stream, datashot); Debug.Log("Shots Saved"); stream.Close(); }
public static ShotData3 LoadShots() { string path = Application.persistentDataPath + "/shot3.save"; if (File.Exists(path)) { BinaryFormatter formatter = new BinaryFormatter(); FileStream stream = new FileStream(path, FileMode.Open); ShotData3 datashot = formatter.Deserialize(stream) as ShotData3; stream.Close(); //Debug.Log("Loading Shots"); return(datashot); } else { //Debug.LogError("savefileNotFound" + path); return(null); } }