public void Load() { if (File.Exists(Application.persistentDataPath + "/buttonInfo.dat")) { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Open(Application.persistentDataPath + "/buttonInfo.dat", FileMode.Open); BallButtonsState data = (BallButtonsState)bf.Deserialize(file); file.Close(); bools = data.bools; } }
public void Save() { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(Application.persistentDataPath + "/buttonInfo.dat"); BallButtonsState data = new BallButtonsState(); data.bools = bools; bf.Serialize(file, data); file.Close(); }