I am looking for help using the LoadNow function of Unity Serializer.
I have level data stored in a database and recalled in game. If I use:
LevelSerializer.LoadSavedLevel(levelData);
It loads perfectly. However, if I use:
LevelSerializer.LoadNow(levelData);
I receive two errors and the level does not load. The two errors that I am receiving are:
Radical.cs:
Serialization error: System.FormatException: Input string was not in the correct format
at System.Int32.Parse (System.String s) [0x00000] in <filename unknown>:0
at Serialization.UnitySerializer.Deserialize (System.IO.Stream inputStream, System.Object instance) [0x00029] in C:\Users\Corey\Desktop\Projects\Games\One\Assets\Plugins\whydoidoit.com\Serialization\UnitySerializer.cs:1099
UnityEngine.Debug:LogError(Object)
Radical:LogError(String, Object) (at Assets/Plugins/whydoidoit.com/Radical/System/Radical.cs:719)
Radical:LogError(String) (at Assets/Plugins/whydoidoit.com/Radical/System/Radical.cs:708)
Serialization.UnitySerializer:Deserialize(Stream, Object) (at Assets/Plugins/whydoidoit.com/Serialization/UnitySerializer.cs:1119)
Serialization.UnitySerializer:Deserialize(Stream) (at Assets/Plugins/whydoidoit.com/Serialization/UnitySerializer.cs:1083)
Serialization.UnitySerializer:Deserialize(Byte[]) (at Assets/Plugins/whydoidoit.com/Serialization/UnitySerializer.cs:1165)
Serialization.UnitySerializer:Deserialize(Byte[]) (at Assets/Plugins/whydoidoit.com/Serialization/UnitySerializer.cs:640)
LevelSerializer:LoadNow(Object, Boolean, Boolean, Action`1) (at Assets/Plugins/whydoidoit.com/Serialization/LevelSerializer.cs:809)
LevelSerializer:LoadNow(Object) (at Assets/Plugins/whydoidoit.com/Serialization/LevelSerializer.cs:777)
$:MoveNext() (at Assets/LevelEditor/LoadLevels.js:67)
and LevelLoader.cs:
NullReferenceException: Object reference not set to an instance of an object
LevelLoader+<Load>c__Iterator2.<>m__46 (.UniqueIdentifier n) (at Assets/Plugins/whydoidoit.com/Serialization/LevelLoader.cs:113)
System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[UniqueIdentifier].MoveNext ()
System.Collections.Generic.List`1[UniqueIdentifier].AddEnumerable (IEnumerable`1 enumerable)
System.Collections.Generic.List`1[UniqueIdentifier]..ctor (IEnumerable`1 collection)
System.Linq.Enumerable.ToList[UniqueIdentifier] (IEnumerable`1 source)
LevelLoader+<Load>c__Iterator2.MoveNext () (at Assets/Plugins/whydoidoit.com/Serialization/LevelLoader.cs:113)
The scene I am serializing into is identical at the time being, but for some reason I am getting this error… I’d really like to load using this function as I don’t want the assets being reset with the level because I have variables that I need to stay…
Any help would be awesome. Thanks everyone.