- Home /
saving data
So I've learned that I can save variable assignments via xml serialization. That seems to only work with primitive data types, though. Is there some way of doing it with custom data types (i.e. textures or your own class)?
There are other methods of saving data you can look at. There is a paid course you can get for FREE on Udemy. It covers 5 different methods to save and load data in Unity3D. It covers PlayerPrefs, Text files, Binary Serialization, Xml Serialization and even SQLite! The free coupon link for this course is https://www.udemy.com/saving-and-loading-game-data-in-unity3d/?couponCode=UNITY Goodluck!
Answer by HarshadK · Jun 04, 2014 at 06:37 AM
If you are not interested in doing all by yourself from scratch and want to have a solution for your problem of saving variety of data then there is a very nice asset called Unity Serializer. And of course it is free.
I'm looking to be able to save and load this:
List<string[]>[] savedArmies = new List<string[]>[4];
Will that allow me to do so easily? X$$anonymous$$L allows me to save it, but loading is a different story.
Yes, you can. Check out the feature of it to save Lists. Version 2.0 supports saving lists.
That sounds awesome! But I don't really understand the getting started guide on there. How do I save my class that isn't attached to any gameobjects?
Well, I just figured out I can easily serialize it with binaryformatter. Thanks, though. I may use that Unity Serializer in the future.