Skip to content

MacacaGames/UnityLitJson

 
 

Repository files navigation

LitJSON

This is a forked version from Mervill.

A .Net library to handle conversions from and to JSON (JavaScript Object Notation) strings. This fork has been edited specificity for use with Unity3D.

Originally created by lbv.

Installation

Option 1: Installation via OpenUPM (Recommend)

openupm add com.macacagames.unitylitjson

Option 2: Unity Package file

Add it to your editor's manifest.json file like this:

{
    "dependencies": {
        "com.macacagames.unitylitjson": "https://github.com/MacacaGames/UnityLitJson.git?path=Source",
    }
}

Licence

This is free and unencumbered software released into the public domain.

For more information, please refer to http://unlicense.org/.

Examples

For general examples, check out /Docs/Quickstart in this repo, there is also a simple example included in the Unity package.

Compiling

The LitJson csproj can be used to compile a dll and run the tests. If you intend to use the library in your Unity3D project I recommend you import the uncompiled source as there are some #if directives in Platform.cs that help make the library work on WinRT (and possibly other platforms in the future).

Compiler Directives

JSON_STANDALONE		// Compile without Unity3D dependencies.

JSON_WINRT			// Compile with WinRT compatibility fix. This will
					// force compilation in Unity3D even if UNITY_METRO
					// is false. It is recommended you only use this if
					// you are using JSON_STANDALONE and are building
					// for WindowsRT

Tests

This library comes with a set of unit tests using the NUnit framework.

TODO

  1. Remove the static writer and just create a new private one each time instead (eliminates need for global lock).
  2. Add more error checks for type hinting.
  3. Add full XMLDocs to public interfaces.
  4. Try to get custom importers/exporters working recursively.
  5. README.md needs more information and examples.
  6. Fix unit tests that cause mono to crash (something with Enums I think).

Packages

No packages published

Languages

  • Roff 45.4%
  • HTML 29.0%
  • C# 12.8%
  • CSS 6.7%
  • JavaScript 6.0%
  • Makefile 0.1%