An open API service indexing awesome lists of open source software.

https://github.com/capsize-games/unitybinaryfilesaver

Simple but useful file saving for Unity3D in C#
https://github.com/capsize-games/unitybinaryfilesaver

Last synced: over 1 year ago
JSON representation

Simple but useful file saving for Unity3D in C#

Awesome Lists containing this project

README

          

# Unity Binary File Saver

![Logo](https://user-images.githubusercontent.com/25737761/166617584-5b05ba5f-2b75-464f-b019-715e3437041e.png)

Very basic binary saving / loading functionality for Unity.

## How to use

Save data by creating a class which implements the blank `ISaveContainer` interface.
Store any serializable classes or properties in your new ISaveContainer class.

- `Assets/Examples/Scripts/GameSaveContainer.cs` example `ISaveContainer` implementation.
- `Assets/Examples/Scripts/Example.cs` saving / loading example.

### Serialization issues

If you see the following error

`SerializationException: Type is not marked as Serializable`

this means you are attempting to serialize an object which is not serializable.
You would see this message when trying to save a GameObject for example. An easy
workaround is to mark this as a non-serialized object:

[NonSerialized]
public GameObject foobar;

See `Assets/Examples/Scripts/GameSaveContainer.cs` for an example