Converting from array to float[]

How?

Error happens with this line:

PlayerPrefsX.SetFloatArray("PIKE0_x",vars.SAmericaInf_x);

vars.SAmericaInf_x is defined like that:

static var SAmericaInf_x = new Array();

Error is stated as:

Any help is appreciated.

Never ever use the JS Array class. It’s bad news and does nothing that you can’t do faster and better with other collections. http://wiki.unity3d.com/index.php?title=Which_Kind_Of_Array_Or_Collection_Should_I_Use?

–Eric

I need to use Arrays because that is only thing supported in ArrayPrefs2… Or you can give me better solution to save some type of collection so when i reopen the game it stays the same as it was before i closed it.

No, JS Arrays are not at all used by ArrayPrefs2. Do not use them. Use standard built-in arrays such as float[ ].

–Eric