Importing JsonFx

I’ve been researching and it seems to be the consensus that if you want to work with json and need it to play nice with IOS, then JsonFx is the way to go.

I was directed to GitHub, here GitHub - jsonfx/jsonfx: JsonFx v2.0 - JSON serialization framework for .NET
And then I downloaded the files.

I end up with a folder called jsonfx-master, and inside the src folder there is jsonfx and jsonfx.tests

Like every other package I’ve worked with I just dragged the main folder into my project, and expect it to work, but it doesn’t. I have 2 errors that pop up, telling me that Querry’1.cs is a name given to 2 different files in the same package, and one of them needs to be renamed. If I change either file name I get new errors in other scripts that were depending on them.

Can someone please explain to me how to add JSonFx to my project? I’ve seen something about a .dll file that needs to go in a plugins folder or something, but I don’t see a .dll file in the package that I downloaded off of github?

any help would be greatly appreciated! Thanks

Not sure if you sorted out the problem but I think you should try different links:

AS of now those are the most up to date.

Download the repository and open *.sln file in MonoDevelop. Build the solution, it should give you a new folder “bin/Debug” or “bin/Release” in project directory, depending on which profile did you choose. There should be the JsonFx.Json.dll.

Then move the dll file to Assets/Plugins folder in your Unity project directory. Now you should be able to use it in your scripts.

I cloned BitBucket: TowerOfBricks / JsonFX for Unity3d and tried to work on Unity on Mac.

I had the same problems.

Here is how I resolved them:

  1. In the two files at Unity Examples/

    -using JsonFx.Json;

    +using Pathfinding.Serialization.JsonFx;

  2. In XmlDataReader and XmlDataWriter

-#if !UNITY3D

+#if !(UNITY_EDITOR || UNITY_ANDROID) // depends on your platform. the purpose is to not build the code

  1. Remove json2.js and UnitTests/Properties/Assembly*

Then build the code got success.

I attached my [43206-patch.txt|43206] file too.

To start to use JsonFX in your code, add

using Pathfinding.Serialization.JsonFx;  

One simple example can be found here.