Search Unity

PlayerPrefsX problem, cant save a big enough array

Discussion in 'Scripting' started by jaasso, Jul 29, 2014.

  1. jaasso

    jaasso

    Joined:
    Jun 19, 2013
    Posts:
    64
    im trying to save a big texture's pixels as a color array with PlayerPrefsX, everything is working fine if the texture is small, but PlayerPrefsX wont save more than 7500 elements, i was wondering if anyone here know of a way to increase the possible amount to save

    saving and loading each individual pixel somehow and then adding them to a texture should work i guess, but im still interested if the size can be increased

    link to PlayerPrefsX script: http://wiki.unity3d.com/index.php/ArrayPrefs2

    im using the c# version

    thanks!
     
    Last edited: Jul 29, 2014
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    That's not a good idea; PlayerPrefs is only intended for smallish amounts of data.

    --Eric
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yes, there are problems, and some platforms can't physically use large amounts anyway. The usage note on that page should not be ignored..."Even though these functions make it easy to save arrays, PlayerPrefs is more suitable for small amounts of data, like locally-stored top 10 lists and that sort of thing. PlayerPrefsX isn't intended to turn PlayerPrefs into a database system. If you have large amounts of data, you should use standard disk IO functions instead."

    --Eric