If I have added some things to the list with code, Does list saves the thing after I exit the application?
If not how to do it?
Without specifically knowing which list you wanted to save…
The component holding the list would have to implement ISaveable
The list would have to be items that are System.Serializable (ints, strings, floats, bools are all good, or a Struct that you have tagged as System.Serializable that contains all serializable components.
Then you would just return the list in OnCaptureState() and cast the object returned from RestoreState to your List myList = (List)state;
Ok thank You Brian but I was wondering if there is some other way to do that because if we store something on a list in the inspector it stays there then why not through code without using saving asset pack…
Because behind the scenes, the Editor is saving the data in the List in the Inspector using a similar method (serializing) the list. Even then, if it’s not a built in class or a class marked [System.Serializable], it won’t be saved in the inspector.
When the game is built, the Editor won’t even be involved in the process anymore.
The Saving Asset Pack is our solution to give you a saving system that can accomplish these things in the game.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.