https://github.com/shadedtechnology/gameserializationsystem
Game data serialization system for Unity game engine
https://github.com/shadedtechnology/gameserializationsystem
loading saving serialization unity unity-asset unity-editor unity-scripts unity2d unity3d unity3d-plugin
Last synced: 6 months ago
JSON representation
Game data serialization system for Unity game engine
- Host: GitHub
- URL: https://github.com/shadedtechnology/gameserializationsystem
- Owner: ShadedTechnology
- License: mit
- Created: 2020-06-24T18:35:53.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-24T21:31:55.000Z (over 5 years ago)
- Last Synced: 2025-03-01T10:46:10.263Z (12 months ago)
- Topics: loading, saving, serialization, unity, unity-asset, unity-editor, unity-scripts, unity2d, unity3d, unity3d-plugin
- Language: C#
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unity Serialization System
Game data serialization system for Unity game engine.
## How to use:
First make sure to use **GameSerialization** namespace:
```C#
using GameSerialization;
```
#### You can save your data in three ways:
- using **SaveableProperty** attribute for your properties:
```C#
[SaveableProperty] public Vector3 vectorToSave {get; set;}
```
- using **SaveableField** attribute for your fields:
```C#
[SaveableField] public Vector3 vectorToSave;
```
- implementing **IOnSaveGameMethod** and **IOnLoadGameMethod** interfaces for your class:
```C#
public class ExampleSaveDataClass : MonoBehaviour, IOnSaveGameMethod, IOnLoadGameMethod
{
private float dataToSave;
public void OnSaveGameMethod(SerializationInfo info)
{
SerializationHelper.SaveObject(info, this, dataToSave, typeof(float));
}
public void OnLoadGameMethod(SerializationInfo info)
{
SerializationHelper.LoadObject(info, this);
}
}
```
### To trigger saving of your scene call:
```C#
public SavingManager savingManager;
...
savingManager.SaveGame(saveName);
```
### To trigger loading of your scene call:
```C#
public SavingManager savingManager;
...
savingManager.LoadGame(saveName);
```