通过VS的包管理器添加了Newtonsoft.Json到项目里面。
虽然在VS里面可以正确引用命名空间 Newtonsoft.Json,
但是Unity报错:
the type or namespace name ‘newtonsoft’ could not be found (are you missing a using directive or an assembly reference?)
看来是Unity找不到程序集,这是因为Json.NET官方没有直接支持Unity。
解决办法:GitHub上有大佬开发了正确在Unity配置Json.NET的工具
只需要下载一个Unity包然后导入到Unity中就行了