In this video, I will show you how to use a binary formatter to save and load data. It might seem scary at first, but the formatter does all the work for you. All you need to do is create a class with your data in basic types ( int, float, bool, string, etc ) and use the formatter to save it and load it. I used my project for character customization as example, but obviously you will want to save and load different things for your games. This also works on mobile & other platforms :)
Here's a few tips on how to make your serializable class
-Save only the data you NEED. For example, if your game has weapons, you don't have to save the weapon sprite, damage, delay, etc unless those values change. If X weapon always has Y speed or damage, don't save those variables.
-Transfer lists into arrays, here's an example:
Level[] levels = new Level[Game.levels.Count];
for(int i = 0; i (less than) Game.levels.Count; i++)
{
levels[i] = Game.levels[i];
}
-Use arrays to keep things clean and small like I did in the example of the videos, instead of using a bunch of different ints, I did a int[]
save load
0:00 Intro
0:29 Creating Script
1:11 Data Class
3:50 Save
5:25 Load
7:40 Example
---
Subscribe for game making tutorials with unity and to follow my projects with the dev logs !
Check out my website for my other socials and if you want to see and try the games I made: https://bit.ly/MaxMakesGames