添加Json.Net到Unity3D项目 [英] Adding Json.Net to a Unity3D project
问题描述
我通过NuGetpackage添加Json.Net库到Visual Studio 2013,并安装了它.net框架4.5。我没有得到一个错误,在Visual Studio当我添加
I added the Json.Net library to Visual Studio 2013 via NuGetpackage and installed it for NetFramework 4.5. I don't get an error in Visual Studio when I add
使用Newtonsoft.Json;
但在Unity3D 5.0我得到错误:
but in Unity3D 5.0 I get the error:
资产/ RobotController.cs(5, 7):错误CS0246:类型或命名空间
名字`Newtonsoft'无法找到。是否缺少使用
指令或程序集引用?
Assets/RobotController.cs(5,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing a using directive or an assembly reference?
我在包抬头为这个项目和文件夹dll文件是存在的,所以我不明白的问题。 THX的帮助。
I looked up in my packages folders for this project and the dll file is there, so I don't understand the problem. Thx for help.
推荐答案
使用simpleJson。它的自由,能够完成工作。
Use simpleJson. Its free and gets the work done.
SimpleJSON.cs内容复制到项目中的一个新创建的文件,你准备好去。如果你想成为幻想 - >创建assets\plugins目录这个新文件
Copy the SimpleJSON.cs contents into a newly created file in your project and you're ready to go. If you want to be fancy -> create this new file in assets\plugins directory
的 http://wiki.unity3d.com/index.php/SimpleJSON
这篇关于添加Json.Net到Unity3D项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!