How can I export data from editor to a text file?


I have a public List that I can edit it’s values in the editor. To backup the values I want to store that List’s data into a text/XML file, serialize it and be able to read it as well.

I think one solution can be to have a custom button on my object that I can export data to a file and read from one.

How can I achieve this?


Consult generic c# references for how to serialize/deserialize XML or txt files. Then you can abstract this process into a single method. Then create a gui button that fires this method.

These resources may also be helpful:

Whydoidoit’s Unity serializer

Unity Gems article about saving/loading data