public static void SavePlayer(MoveByTouch moveByTouch) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/poly.bin"; FileStream stream = new FileStream(path, FileMode.Create); PlayerData data = new PlayerData(moveByTouch); formatter.Serialize(stream, data); stream.Close(); }
public PlayerData(MoveByTouch moveByTouch) { highScore = moveByTouch.highScore; }