briochie / wow.unity

A collection of assets to make working with wow.export easier in Unity.
MIT License
18 stars 8 forks source link

Add explicit Newtonsoft.Json dependency #23

Closed oyvind-stromsvik closed 6 months ago

oyvind-stromsvik commented 6 months ago

We depend on this package, but this dependency isn't explicitly defined so if wow.unity is installed in a project not already containing Newtonsoft.Json then it will throw errors.

Note: I don't know how to add minimum dependencies in the Unity package manager, or if that is even supported. Like there's no specific reason I required version 3.2.1 of this package except for the fact that it was the latest version at the time. If I required 3.0.0 or 1.0.0 or whatever, then Unity would not fetch the latest version automatically.

briochie commented 6 months ago

Thanks for this - I forgot this is absolutely needed, thank you.

There should be a way to set the dependency to be more flexible. For example:

"com.unity.nuget.newtonsoft-json": "^3.2.x"
oyvind-stromsvik commented 6 months ago

Well... 😅

The ^ notation and similar notations is what I'm used to from Composer which I use for work with PHP, but I couldn't get anything like that to work here. I tried the package again now after your merge and now I get: com.unity.nuget.newtonsoft-json (dependency): Version '^3.2.1' is invalid. Expected a 'SemVer' compatible value. [UpmError_NotFound].

oyvind-stromsvik commented 6 months ago

I quickly tried 3.x.x as well, but similar error.

fnio5 commented 6 months ago

How about maybe just removing that dependency and using the unity built-in JsonUtility is that possible?

briochie commented 6 months ago

How about maybe just removing that dependency and using the unity built-in JsonUtility is that possible?

No, not with how wow.export creates it's json. The structure is too complex and unpredictable for unity's JsonUtility.

briochie commented 6 months ago

I quickly tried 3.x.x as well, but similar error.

I went ahead and reverted it back to the way you had done it. I was so confident it would work lol.

Sorry about that. Been a bit since I've touched this project. 😓