I am making a brick building game, and I want users to be able to save. any way to do this? or would I have ot write to a file?
things I would need to save.
•Places in hierarchy
I think I would be able to do this, but would there be an easy way to? and If not, any suggestions on how to save these things?
(Especialy place in hierarchy, I use those for physics).
Unity does not supply a saving system other than PlayerPrefs. But I dont think playerPrefs meets ur need here. You can’t use it to save data bigger than 1mb (only true for webplayer builds). It is mostly usefull for small save data and/or player preference settings. PlayerPrefs
But there is a guy (a really nice guy) who have build a whole library to help people to save progress in their game. You should definitly take a look : Unity Serializer.
And it’s completly free!
Or you can create ur own serializer. A few methods can be used:
using System.BitConverter and such - Most compact way to serialize, but also probly the most unpratical way too.
Fast and easy, would probly be really easy to store places in ur hierarchy with this. But some people feel like it’s unsecure, but u can always encrypt ur data
JSON is smaller and faster than XML, but it a little bit harder to learn than XML. Also Unity Serializer use this method.
*And for the place in the hierarchy serialization, it will all depends on which system u decide to use. Binary Data would require a child/parent reference system, as for xml and json it would be alot easier since both of these system are hierarchical. As for Unity Serializer I think it would be the easiest since u can decide which part of ur gameobject u want to serialize… but I might be wrong since I’ve never used it.