https://github.com/audunegames/object-serialization
Custom and extensible object serialization for Unity.
https://github.com/audunegames/object-serialization
messagepack serialization unity
Last synced: 2 months ago
JSON representation
Custom and extensible object serialization for Unity.
- Host: GitHub
- URL: https://github.com/audunegames/object-serialization
- Owner: audunegames
- License: lgpl-3.0
- Created: 2024-09-22T23:51:50.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-12-27T18:18:39.000Z (over 1 year ago)
- Last Synced: 2024-12-27T19:22:58.354Z (over 1 year ago)
- Topics: messagepack, serialization, unity
- Language: C#
- Homepage:
- Size: 89.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Audune Object Serialization
[](https://openupm.com/packages/com.audune.serialization/)
Custom and extensible object serialization for Unity, using intermediate state classes.
See the [wiki](https://github.com/audunegames/object-serialization/wiki) of the repository to get started with the package.
## Features
* Serialize and deserialize primtive values and Unity structs to and from intermediate state classes respectively. Easily create your own serializable classes and structs by implementing the `ISerializable` interface and crafting a state structure reminiscent of JSON.
* Encode and decode states and objects that can be serialized to states to a string or byte array for storage on a filesystem or sending over a network.
* Use the [Object Persistence package](https://github.com/audunegames/object-persistence) for a higher-level library to save and load states to and from the filesystem, repsectively, or any other filesystem adapter.
### Supported serialization types
* C# value types: `bool`, `byte`, `sbyte`, `ushort`, `short`, `uint`, `int`, `ulong`, `long`, `float`, `double`.
* C# reference types: `string`, `byte[]`.
* Unity structs: `Vector2`, `Vector3`, `Vector4`, `Vector2Int`, `Vector3Int`, `Color32`, `Color`, `Quaternion`, `Rect`, `Bounds`, `RectInt`, `BoundsInt`.
* Any custom class that implements `Audune.Serialization.ISerializable`.
### Supported encoders
* [MessagePack](https://msgpack.org/) with optional LZ4 compression, using the [MessagePack-CSharp](https://github.com/MessagePack-CSharp/MessagePack-CSharp) library.
## Installation
### Requirements
This package depends on the following packages:
* [MessagePack](https://openupm.com/packages/net.tnrd.messagepack/), version **2.5.125** or higher.
If you're installing the required packages from the [OpenUPM registry](https://openupm.com/), make sure to add a scoped registry with the URL `https://package.openupm.com` and the required scopes before installing the packages.
### Installing from the OpenUPM registry
To install this package as a package from the OpenUPM registry in the Unity Editor, use the following steps:
* In the Unity editor, navigate to **Edit › Project Settings... › Package Manager**.
* Add the following Scoped Registry, or edit the existing OpenUPM entry to include the new Scope:
```
Name: package.openupm.com
URL: https://package.openupm.com
Scope(s): com.audune.serialization
```
* Navigate to **Window › Package Manager**.
* Click the **+** icon and click **Add package by name...**
* Enter the following name in the corresponding field and click **Add**:
```
com.audune.serialization
```
### Installing as a Git package
To install this package as a Git package in the Unity Editor, use the following steps:
* In the Unity editor, navigate to **Window › Package Manager**.
* Click the **+** icon and click **Add package from git URL...**
* Enter the following URL in the URL field and click **Add**:
```
https://github.com/audunegames/object-serialization.git
```
## License
This package is licensed under the GNU LGPL 3.0 license. See `LICENSE.txt` for more information.