在unity中添加System.Windows.Forms引用和注意事项
1 到unity安装目录拷贝System.Windows.Forms.dll到unity工程下Assets下的新建文件夹Plugins中,这个引用在Unity安装目录\Editor\Data\Mono\lib\mono\2.0 ,不要拷贝错了,C盘Microsoft.NET下也有这引用,同时unity安装目录也有很多个这引用,虽然在unity编辑器里面运行一点问题都没有,但打包出去会出现错误。
2 在Visual Studio中添加引用,右击Reference(应用)\Add Reference(添加引用),然后弹出添加应用对话框,把Assets/Plugins的引用System.Windows.Forms添加进来,如下图:
然后再代码添加命名空间,using System.Windows.Forms;
3 修改Edit -> Project Settings -> Player->Other Setting中的API Compatibility Level为.Net 2.0
注意:上面步骤少一步都不行,虽然在unity编辑器里面运行一点问题都没有,但打包会出现问题
测试:弹出对话框
//按下鼠标左键弹出对话框
if(Input.GetMouseButtonDown(0)){
}
————————————————
版权声明:本文为CSDN博主「zxy2847225301」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/zxy13826134783/article/details/79660950
在unity中添加System.Windows.Forms引用和注意事项相关推荐
- c#+AE开发中,System.Windows.Forms.AxHost.InvalidActiveXStateException 在 ESRI.ArcGIS.AxControls.dll 中发生
问题描述图 //目标框架由3.5改为4.5后会出现无法启动的错误,System.Windows.Forms.AxHost+InvalidActiveXStateException"的异常, ...
- System.Windows.Forms.ListView : Control
#region 程序集 System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ...
- System.Windows.Forms.Timer在线程中的注意事项
在WinForm中使用System.Windows.Forms.Timer对象,如果是在单线程中使用,则直接设置该对象的Enabled属性值即可启动计时器,但如果是在多线程窗体中在多线程引发的事件中调 ...
- System.Timers.Timer 嵌套 System.Windows.Forms.Timer的问题
如题"System.Timers.Timer 嵌套 System.Windows.Forms.Timer的问题",最近在项目中在类uc_Map中启用了System.Timers.T ...
- 使用.net 6.0框架的WPF应用如何引用System.Windows.Forms这个dll
在.net 6.0的WPF应用中,想使用OpenFileDialog 这个类或者FolderBrowserDialog这个类,是无法找到System.Windows.Forms这个dll引用的,即使从 ...
- Resx 文件无效。未能加载 .RESX 文件中使用的类型 System.Collections.Generic.List`1请确保已在项目中添加了必需的引用。
在C#程序编写过程中,会遇到:Resx 文件无效.未能加载 .RESX 文件中使用的类型 System.Collections.Generic.List1`请确保已在项目中添加了必需的引用. 主要原因 ...
- c#使用System.Windows.Forms.DataVisualization.Charting.dll绘制图表实例
首先下载System.Windows.Forms.DataVisualization.Charting.dll,然后引用到项目中 手动在代码中创建chart类型并将其添加到某个控件中(control. ...
- System.Windows.Forms.Timer与System.Timers.Timer的区别
.NET Framework里面提供了三种Timer: System.Windows.Forms.Timer System.Timers.Timer System.Threading.Timer VS ...
- System.Windows.Forms.ListView
呈现一个 Windows 列表视图控件,并且能够以四种不同的视图中的任何一种来显示一个子项集合. 命名空间:System.Windows.Forms 汇编集:System.Windows.Forms( ...
- System.Timers.Timer与System.Windows.Forms.Timer 区别
根据msdn解释:System.Threading.Timer 是一个简单的轻量计时器,它使用回调方法并由线程池线程提供服务. 不建议将其用于 Windows 窗体,因为其回调不在用户界面线程上进行. ...
最新文章
- Firefox下载自动保存
- [LeetCode] Wildcard Matching 题解
- Nhibernate 3.0 cookbook学习笔记 创建事务自动包裹的访问层
- 新基建带来新机遇!大数据产业发展需“四驱”推动
- MySQL_存储引擎
- MySQL Processlist 讲解
- uitableview有个属性值 separatorStyle 可用来去掉cell间的白线:
- 安装 PHP memcached 扩展遇到的3个问题
- 2022-08-19 mysql/stonedb-索引优化专利交底书-改进点
- Java是什么?Java到底能干嘛?
- word模板填充数据,导出PDF
- 考拉兹猜想(Python版)
- Bootstrap(三) 网格系统
- c++上三角矩阵求和
- maven依赖的添加
- 【TouchDesigner】Feedback的应用NO.1
- CIF,D1,HALF D1,FULL D1
- 2023最新Vue 面试题+详解答案
- 云开发--实现发送邮件+短信+链接跳转小程序功能
- android亮屏、暗屏、解锁、关闭系统对话的监听事件
热门文章
- (转)1.43亿用户信息泄露案后 美国征信机构CEO离职
- Rust: join,与concat
- 云栖回顾|龙蜥论坛圆桌环节都有哪些精彩观点?
- 一文读懂「云上企业级存储」
- 【优化求解】基于matlab粒子群算法求解仓库成本控制优化问题【含Matlab源码 1577期】
- 【数字信号处理】基于matlab GUI频谱分析仪【含Matlab源码 932期】
- 【水果识别】基于matlab GUI形态学水果大小识别【含Matlab源码 920期】
- 【空瓶识别】基于matlab灰度+二值化空瓶检测【含Matlab源码 806期】
- 【基础教程】基于matlab图像处理图像分割【含Matlab源码 191期】
- 机器学习算法的差异_我们的机器学习算法可放大偏差并永久保留社会差异