Exemple #1
0
		static void Serialize(ProtoBuf.IExtensible message)
		{
			PlayerPrefs.SetInt("Version", 1);
			byte[] buf = null;
			using(var mem = new MemoryStream())
			{
				ProtoBuf.Serializer.Serialize(mem, message);
				buf = mem.ToArray();
			}
			PlayerPrefs.SetString("UserData", Convert.ToBase64String(Crypto.Encode(buf)));
			Debug.Log("Serialize: " + message.Dump());
		}