https://github.com/evskii/unitysaveloadsystem
A save/load system for Unity utilizing playerprefs so you can have persistent data on WebGL.
https://github.com/evskii/unitysaveloadsystem
playerprefs save-files savedata savegame unity unity2d unity3d unitypackage videogames videogames-unity webgl
Last synced: 8 months ago
JSON representation
A save/load system for Unity utilizing playerprefs so you can have persistent data on WebGL.
- Host: GitHub
- URL: https://github.com/evskii/unitysaveloadsystem
- Owner: evskii
- Created: 2022-03-03T12:11:40.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-05T14:23:03.000Z (about 4 years ago)
- Last Synced: 2025-03-05T16:36:42.495Z (about 1 year ago)
- Topics: playerprefs, save-files, savedata, savegame, unity, unity2d, unity3d, unitypackage, videogames, videogames-unity, webgl
- Language: C#
- Homepage:
- Size: 30.3 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# UnitySaveLoadSystem
This is a small and easy to use package created so that you can use a single Player Prefs key to store all of your data in Unity. It works by putting data into a custom struct called DataBlocks and converting each DataBlock into a single string and storing that in the Player Prefs. This makes it super easy for having data carry over sessions on WebGL games.
You can find the script [HERE](https://github.com/evskii/UnitySaveLoadSystem/blob/main/SaveLoadSystem/Assets/Scripts/SaveLoadSystem.cs), or download the whole project to see it in action (not very exciting)!
### How To Use:
- Store SaveLoadSystem.cs somewhere in your project files and you are good to go.
- Data is stored in DataBlocks using an identifier and a value. Create a DataBlock and then call SaveLoadSystem.Save(DataBlockHere); to save a single data block.
- You can also pass an array of DataBlocks if you want to store more than one at a time. (If you pass in a DataBlock with an identifier that is already in use it overrides the old value. Good for updating values, bad if that is not what you want to do :/).
- You can then call LoadAll(); to get an array of all DataBlocks that are saved, or LoadSpecificBlock(string identifier); to load a single block.
- **Don't attempt to use Load methods before saving for the first time as it returns errors.**
### Usage Rights:
Go for it! Credit me if you want, don't if you dont x
**If you find any bugs, feel free to let me know!**