• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by InfiniBuzz · Jun 12, 2013 at 09:41 PM · playerprefssavingdata

Efficient data saving? PlayerPrefs vs. XMLSerialization

Hi

I know this subject is highly depending on the individual needs and setups. But I'm wondering what would be the best way of saving data. I couldn't find anything really useful yet.

What method is better in performance? (also considering mobile platforms)

I know there may be no general answer to this so I will need to save about 10 to 50 object positions and a few other variables.

Can someone recommend me one of the methods? I'm quiet familiar with XMLSerializing however I didn't use it in unity and don't know how performance is and what needs to be considered here, and I'm interested in finding the best possible way :)

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image InfiniBuzz · Jun 28, 2013 at 11:41 AM 0
Share

here too, thanks for downvoting without a comment

avatar image Fattie · Jun 28, 2013 at 11:43 AM 0
Share

who the hell downvoted this ??

perhaps someone just clicked the wrong button - don't worry

1 Reply

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by Fattie · Jun 13, 2013 at 08:00 AM

Hello!

A - check out Unity Serializer (by Whydoidoit, a top unity dev). it is free and very widely used in almost every project

B - FTR you can't use PlayerPrefs in the real world because it's not encrypted or obfuscated. it's only for demos and learning. you'd have to use Secured PlayerPrefs (works identically) from the asset store, or, write your own

C - note that Eric5h5 has the excellent array prefs system which may make your life easier. Very cleverly, the "Secured PlayerPrefs" guy included an array feature, so if you do use "Secured PlayerPrefs" your job is totally done if you want an array as well

D - 50 items is zero so forget performance aspects. there are absolutely no performance considerations here in any way. (Note that you'd just be keeping your 50 positions in a simple List during play, and from time to time you'd save it. there's no performance aspect.)

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image InfiniBuzz · Jun 13, 2013 at 08:23 AM 1
Share

Thanks for answering my questions. I've seen the Asset from whydoidoit, I have to test how it affects the game size. But I think I'll stick to that one.

avatar image Fattie · Jun 13, 2013 at 08:39 AM 1
Share

here to serve! :) yeah unity serializer is amazing

there's no reason you can't simply use PlayerPrefs to get you going. enjoy!

Your answer

Hint: You can notify a user about this post by typing @username

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

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Saving public variable data set in inspector? 1 Answer

Saving usermade creations in game 1 Answer

Saving PlayerPrefs in Google Chrome NaCl 0 Answers

PlayerPrefs save after quit? 2 Answers

PlayerPrefs.GetString not saving past values 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges