- Home /
Question by
noahg1 · Mar 30, 2014 at 06:16 PM ·
c#load levelsave gameunityserializer
UnitySerializer not loading levels
Hi, I get the error below when I try and use LoadSavedLevelFromFile() and when I try and pass a string to LoadSavedLevel(). I know the string contains data because I always orint the sting to the console before calling and the text file is not empty. Could someone point me in the right direction to solving this issue, I need it asap and I cannot seem to trace the issue.
System.ArgumentNullException: Argument cannot be null.
Parameter name: buffer
at System.IO.MemoryStream..ctor (System.Byte[] buffer) [0x0000c] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.IO/MemoryStream.cs:80
at (wrapper remoting-invoke-with-check) System.IO.MemoryStream:.ctor (byte[])
at Serialization.UnitySerializer.Deserialize (System.Byte[] bytes) [0x0001d] in C:\Users\Noah\Documents\Paradox\Assets\Plugins\whydoidoit.com\Serialization\UnitySerializer.cs:1306
at Serialization.UnitySerializer.Deserialize[LevelData] (System.Byte[] array) [0x00017] in C:\Users\Noah\Documents\Paradox\Assets\Plugins\whydoidoit.com\Serialization\UnitySerializer.cs:642
at LevelSerializer.LoadSavedLevel (System.String data) [0x0002e] in C:\Users\Noah\Documents\Paradox\Assets\Plugins\whydoidoit.com\Serialization\LevelSerializer.cs:1175
at scriptUploadManagerv2.OnClick () [0x000a7] in C:\Users\Noah\Documents\Paradox\Assets\Levels\scriptUploadManagerv2.cs:69
UnityEngine.MonoBehaviour:print(Object)
scriptUploadManagerv2:OnClick() (at Assets/Levels/scriptUploadManagerv2.cs:83)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:821)
UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1484)
UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:1109)
UICamera:ProcessTouches() (at Assets/NGUI/Scripts/UI/UICamera.cs:1179)
UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:969)
I am also recieving the following error when I try to use the example Pause menu script when I try and load a level
NullReferenceException: Object reference not set to an instance of an object
LevelLoader+<Load>c__Iterator8.<>m__C3 (UnityEngine.Component c) (at Assets/Plugins/whydoidoit.com/Serialization/LevelLoader.cs:250)
System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[UnityEngine.Component].MoveNext ()
System.Collections.Generic.List`1[UnityEngine.Component].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
System.Collections.Generic.List`1[UnityEngine.Component]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
System.Linq.Enumerable.ToList[Component] (IEnumerable`1 source)
LevelLoader+<Load>c__Iterator8.MoveNext () (at Assets/Plugins/whydoidoit.com/Serialization/LevelLoader.cs:250)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
<PerformLoad>c__IteratorB:MoveNext() (at Assets/Plugins/whydoidoit.com/Serialization/LevelSerializer.cs:1155)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
LevelSerializer:LoadNow(Object, Boolean, Boolean, Action`1) (at Assets/Plugins/whydoidoit.com/Serialization/LevelSerializer.cs:1150)
LevelSerializer:LoadNow(Object) (at Assets/Plugins/whydoidoit.com/Serialization/LevelSerializer.cs:1106)
PauseMenu:OnGUI() (at Assets/UnitySerializer/Scripts/PauseMenu.js:58)
Comment
Your answer
Follow this Question
Related Questions
Saving voxel terrain 2 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
NullReferenceException and m_InstanceID == 0 on LoadLevel (C#) 1 Answer