x


Serialization in unity Iphone basic

Hey, i'm trying to find a way to save a whole lot of savegame data. using unity iphone basic , latest version (1.7)

I've been trying several approaches. 1. First i tried to use a Binaryformatter method frmo this post : http://answers.unity3d.com/questions/971/how-to-scrip-a-save-load-game-option (i did a small change and instead of saving it to a file stream i save it to a memory stream, convert to Base64 and save to profileprefs)

it worked perfectly in the editor, then when i came to compile and try it out on the device i got this error: This mono runtime was configured with --enable-minimal=reflection_emit, so System.Reflection.Emit is not supported.Program received signal: SIGABRT

Reading on the matter i found this thread: http://forum.unity3d.com/viewtopic.php?p=335296#335296

but i chose in player preferences to use .net 2.1. instead of 1.1 (p.s. do i need to do a rebuild when i change player settings?)

2. Then i tried this method with XML: http://www.unifycommunity.com/wiki/index.php?title=Save_and_Load_from_XML

It fails when i try to serialize a class that has a hashtable in it : InvalidOperationException: There was an error reflecting field 'itemsInventory'.

I'm really stuck here, as i have dozens of classes in the game and i wouldn't want to start implementing manual serialization functions for every class. especially those ones with arrays and hashtables.

what can i do ? any ideas?

Oded

more ▼

asked Jun 16 '10 at 04:52 PM

SoundGuy32 gravatar image

SoundGuy32
78 6 7 13

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

You won't be able to serialize generics / dictionary objects in Unity iPhone 1.7. There is mention this will be supported when 3.0 comes out.

more ▼

answered Jun 23 '10 at 12:15 PM

BoredKoi gravatar image

BoredKoi
391 7

bummer. well, i did some stuff with XML serialization, which paritally worked when not dealing with floats of complex types.

Jun 24 '10 at 05:46 AM SoundGuy32
(comments are locked)
10|3000 characters needed characters left

Has there been any word of the offical support of this. We're getting an issue at runtime serializing some data in the 3.0 beta

more ▼

answered Sep 29 '10 at 04:30 PM

user-5056 (google) gravatar image

user-5056 (google)
1

(comments are locked)
10|3000 characters needed characters left

bump,... anybody have any luck serializing hashtable or generics in unity 3.5 ios ?

more ▼

answered Oct 05 '12 at 12:15 AM

sims11tz gravatar image

sims11tz
-4

I can deserialize lists on iphone in 3.5 (data sent over the wire from a mac) but can't serialize them. Get the below error:

Unhandled Exception: System.ExecutionEngineException: Attempting to JIT compile method 'UInt32__TypeMetadata:.ctor ()' while running with --aot-only.

I suppose I'll have to convert the list to an array to work...

Nov 10 '12 at 12:21 AM Michal T.
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1998
x435
x255
x47
x3

asked: Jun 16 '10 at 04:52 PM

Seen: 2859 times

Last Updated: Nov 10 '12 at 12:21 AM