Browse Source

Disabled binary serialisation on WinRT

master
chrisgregan 10 years ago
parent
commit
57d846ba96
  1. 6
      Assets/Fungus/FungusScript/Scripts/GlobalVariables.cs

6
Assets/Fungus/FungusScript/Scripts/GlobalVariables.cs

@ -3,7 +3,9 @@ using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
#if !UNITY_WINRT
using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization.Formatters.Binary;
#endif
using System.IO; using System.IO;
namespace Fungus namespace Fungus
@ -24,6 +26,7 @@ namespace Fungus
*/ */
public static void Save(string saveName) public static void Save(string saveName)
{ {
#if !UNITY_WINRT
// Save strings // Save strings
{ {
var b = new BinaryFormatter(); var b = new BinaryFormatter();
@ -57,6 +60,7 @@ namespace Fungus
} }
PlayerPrefs.Save(); PlayerPrefs.Save();
#endif
} }
/** /**
@ -64,6 +68,7 @@ namespace Fungus
*/ */
public static void Load(string saveName) public static void Load(string saveName)
{ {
#if !UNITY_WINRT
var stringData = PlayerPrefs.GetString(saveName + "." + "stringDict"); var stringData = PlayerPrefs.GetString(saveName + "." + "stringDict");
if (string.IsNullOrEmpty(stringData)) if (string.IsNullOrEmpty(stringData))
{ {
@ -99,6 +104,7 @@ namespace Fungus
var m = new MemoryStream(Convert.FromBase64String(boolData)); var m = new MemoryStream(Convert.FromBase64String(boolData));
boolDict = b.Deserialize(m) as Dictionary<string, bool>; boolDict = b.Deserialize(m) as Dictionary<string, bool>;
} }
#endif
} }
/** /**

Loading…
Cancel
Save