发布时间:2019-07-06 10:42:44编辑:auto阅读(3705)
转载自:http://download.csdn.net/download/ximenguyu/7639659
一、问题:
Assets/Scripts/SerialPortReciever.cs(7,17):error CS0234: The type or namespace name `Ports' does not exist in thenamespace `System.IO'. Are you missing an assembly reference?
本人使用的版本是Unity3D4.2,想在游戏里加串口通信的代码,结果编辑器一直报以上的错误,其实在代码里已经包含命名空间的导入,而且代码编辑器也没有报错:
usingSystem.IO.Ports;
二、解决办法:
1、打开Unity工程,在菜单栏中点开File-->Build Setting...
2、在设置中找到
OtherSetting-->Optimization-->Api Compatibility Level-->.NET2.0
3、重启Unity,之后就不会有同样的报错了;
4、如果想在Unity中使用对数据库的操作(System.Data.dll)同样要按以上步骤设置;
上一篇: RedHatLinux AS3 U3 安
下一篇: NTV Media Server G3
53063
39987
34370
30121
25015
24822
23195
16660
14831
14331
651°
611°
672°
690°
738°
863°
826°
848°
947°
871°