Overview

image

Unity package library for serializing and deserializing TOML data.

NOTE: This package is still in development and may have breaking changes in future versions until a stable v1.0.0 release is made.

What is TOML?

TOML is a relatively newer file format, similar to JSON and YAML files, used for storing data in a human-readable format.

Why use TOML?

  • Simple and straightforward format.
  • Easy to read and write, especially for humans.
  • Less overhead and control characters than JSON.
  • Supports comments.

Why use this package?

While there are various TOML libraries available for .NET, this package aims to provide a simple and easy to use API for serializing and deserializing TOML data in Unity.

It aims to provide a familiar API to Unity's JsonUtility API for serializing and deserializing JSON data. Additionally, it provides ways to customize the serialization process via attributes similar to those in Microsoft's System.Text.Json namespace.

It is also covered with unit tests to ensure the reliability of the package library as new features are introduced.

Compatibility

This package is compatible with Unity 2019.1 and later. It only uses C# 7.3 features and targets .NET Framework 4.6.

While it is recommended to use one of the latest LTS releases of Unity, there are older projects that may opt to use this library.

Limitations

While this package does implement most of the TOML 1.0 specification, it is not intended to support every aspect of the specification.. It is intended to provide a simple, easy-to-use, and performant library for serializing and deserializing objects to and from TOML format for the majority of use cases.

That means when importing TOML files generated by other libraries or programs, there may be some issues with deserialization. However, if you are using this library to generate TOML files, you should not have any issues.