public static void SaveIndexForUO(CharacteristicsHero characteristicsHero) { BinaryFormatter bf = new BinaryFormatter(); FileStream stream = new FileStream(Application.dataPath + "/data/ii.sav", FileMode.Create); DataIndexForUO data = new DataIndexForUO(characteristicsHero); bf.Serialize(stream, data); stream.Close(); }
public static int[] LoadIndexForUO() { if (File.Exists(Application.dataPath + "/data/ii.sav")) { BinaryFormatter bf = new BinaryFormatter(); FileStream stream = new FileStream(Application.dataPath + "/data/ii.sav", FileMode.Open); DataIndexForUO data = bf.Deserialize(stream) as DataIndexForUO; stream.Close(); return(data.indexForUO); } else { return(new int[0]); } }