Kon*_*nda 8 c# json unity-game-engine visual-studio
我通过NuGetpackage将Json.Net库添加到Visual Studio 2013,并将其安装到NetFramework 4.5中.添加时,我在Visual Studio中没有出现错误
using Newtonsoft.Json;
但在Unity3D 5.0中我收到错误:
Assets/RobotController.cs(5,7):错误CS0246:找不到类型或命名空间名称"Newtonsoft".您是否缺少using指令或程序集引用?
我在我的包文件夹中查找了这个项目,dll文件就在那里,所以我不明白这个问题.谢谢你的帮助.
小智 5
使用simpleJson.它是免费的,并完成工作.
将SimpleJSON.cs内容复制到项目中新创建的文件中,您就可以开始了.如果你想要花哨 - >在assets\plugins目录中创建这个新文件
http://wiki.unity3d.com/index.php/SimpleJSON
对于内置版本的支持,建议使用以下之一
Json.NET v12.0 github.com/jilleJr/Newtonsoft.Json-for-UnityJson.NET v9.0 github.com/SaladLab/Json.Net.Unity3DJson.NET v8.0 parentelement.com/assets/json_net_unityJson.NET v7.0 nuget.org/packages/Unity.Newtonsoft.Json/或者,如果您不需要 Newtonsoft.Json (Json.NET),这里有一些其他的替代方案(都在 Unity 中工作,我省略了不需要的库,并且有很多):
OdinSerializer github.com/TeamSirenix/odin-serializerUTF8Json github.com/neuecc/Utf8JsonFastJSON assetstore.unity.com/packages/tools/input-management/fastjson-27220UltimateJson assetstore.unity.com/packages/tools/integration/ultimate-json-60845SimpleJson wiki.unity3d.com/index.php/SimpleJSONLitJson github.com/Mervill/UnityLitJsonFullSerializer github.com/jacobdufault/fullserializerprotobuf-net github.com/protobuf-net/protobuf-net有相当多的糖果表可供选择。选择年轻的学徒吧~