Git Product home page Git Product logo

Comments (6)

IceflowRE avatar IceflowRE commented on August 14, 2024

Why it wont work well?

from json.net.unity3d.

veblush avatar veblush commented on August 14, 2024

@alexbestul Wow! you mean that your project is using nuget package system for Unity project? Could you tell me more detail and packages which you're using?

Basically nuget doesn't support Unity3D and there is no target moniker for Unity3D. (Ref: Targetframeworks) so how can i make a package for Unity3D?

from json.net.unity3d.

alexbestul avatar alexbestul commented on August 14, 2024

It's not as fancy as you're imagining, I'm afraid.

We simply use Visual Studio to compile our game's C# source into DLLs, and then drop those DLLs into the Unity project's Assets folder. We add dependencies to the csproj using Visual Studio's standard mechanisms (either as direct DLL references or through NuGet), and then make sure that those DLLs get copied into the Unity project as well.

You are correct that NuGet doesn't allow us to target a package specifically for Unity, but simply targeting .NET 2.0 or .NET 3.5 should be sufficient.

The NuGet package would contain exactly the same DLL that the UnityPackage contains, just packaged and distributed differently.

from json.net.unity3d.

veblush avatar veblush commented on August 14, 2024

Ok. I got the point. Instead of publishing new nuget package dedicated only for Unity3d, how about following scheme which my project is using?

  • Use common Newtonsoft.Json for VS game project.
  • Output DLL from VS game project will be copied to Unity3D assets folder except Newtonsoft.Json.Dll because it doesn't support Unity3D.
    • In the meantime, reference to Newtonsoft.Json.Dll of output dll should be modified to strip out strong naming information.
    • You can do it simply by using sfk tool like sfk.exe rep "DLLPATH" -pat -bin /0830ad4fe6b2a6aeed/000000000000000000/ -yes (It helps to check how TrackableData handle this)
  • Place Json.Net.Unity3D package in Unity3D asset folder. (It has to be done at first time.)
  • Unity3D project works successfully because Newtonsoft.Json and Json.Net.Unity3D has same DLL name and no strong naming information.

It requires no another nuget package and makes game project DLL run under normal .NET environment.

from json.net.unity3d.

alexbestul avatar alexbestul commented on August 14, 2024

Thanks for your feedback. I can see how that approach would work, but I would still prefer to have a NuGet package, so we can follow our existing workflow.

If you aren't interested in maintaining an official package, then no worries. I completely understand not wanting to take on that burden. We'll find a way to make things work that fits our needs, and you can close this issue if you'd like.

from json.net.unity3d.

veblush avatar veblush commented on August 14, 2024

Thanks for generous understanding 😄
Still now, I think that the another nuget package is too specialized to keep it official.

from json.net.unity3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.