So I upgraded to unity 4.6.1 and now I'm getting this error:
SerializationException: serializationStream supports seeking, but its length is 0
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:155)
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:136)
AC.Serializer.DeserializeObjectBinary[OptionsData] (System.String pString) (at Assets/AdventureCreator/Scripts/Save system/Serializer.cs:110)
AC.SettingsManager.ShowGUI () (at Assets/AdventureCreator/Scripts/Managers/SettingsManager.cs:429)
AdventureCreator.OnGUI () (at Assets/AdventureCreator/Scripts/Managers/Editor/AdventureCreator.cs:138)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
I'm using AC 1.40b
I get this problem when I click settings on the game editor.
Comments
Thanks for the warning. I'll update to 4.6.1 myself and see if this is a general issue.
EDIT: Works fine for me. I'll need to know more about your system.
BUMP
I'm having the exact same problem with 4.6 when I click on the settings tab.
Specs:
Windows 7 Pro 64 SP1
AMD FX-8350 4.0 GHZ 8-Core
8 GB RAM
public static T DeserializeObjectBinary <T> (string pString)
Now insert the following just after the opening bracket on the next line:
if (pString.Length == 0) return;
Does that solve the issue?
I followed your directions on my machine, and the compiler sent this error:
"Assets/AdventureCreator/Scripts/Save system/Serializer.cs(99,43): error CS0126: An object of a type convertible to `T' is required for the return statement"
if (pString.Length == 0) return default (T);
Thanks for the reply. The console report:
NullReferenceException: Object reference not set to an instance of an object
AC.SettingsManager.ShowGUI () (at Assets/AdventureCreator/Scripts/Managers/SettingsManager.cs:520)
AdventureCreator.OnGUI () (at Assets/AdventureCreator/Scripts/Managers/Editor/AdventureCreator.cs:138)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Line 518 reads:
optionsData = Serializer.DeserializeObjectBinary (optionsBinary);
Replace it with the following:
After a nervous click on the Settings tab, I had a feeling of relief as I saw it worked!
Thanks Chris!