当前位置:网站首页>Unity VS—— VS中默认调试为启动而不是附加到Unity调试
Unity VS—— VS中默认调试为启动而不是附加到Unity调试
2022-07-25 20:36:00 【ۓ明哲ڪ】
声明:本文为个人笔记,用于学习研究使用非商用,内容为个人研究及综合整理所得,若有违规,请联系,违规必改。
文章目录
开发环境
Unity 2018.2.3
Visual Studio 2019(以下简称VS)
一、问题描述
通过Unity打开脚本后 visualstudio调试按钮显示为启动而非附加到Unity.如下图一所示:
图一(错误效果)
图二(正确效果)
二、问题原因及解决方案
问题产生原因:
原因一——可能未安装对应工具
猜测可能是因为VS为后期自己安装,而非安装Unity时通过它提供的选项下载安装导致VS的调试未和Unity进行完全关联(仍可通过VS菜单栏调试——附加到Unity程序进行调试,但VS默认显示按钮为启动而非附加到Unity).
原因二:当前版本对高版本VS部分功能默认不支持
Unity2018对应的默认下载VS为2017,可能该版本Unity并不能很好的支持VS2019
解决方案:
通用步骤:
打开VS安装程序 Visual Studio Installer —— 修改——单个组件——搜索Unity,并安装Visual Studio Tools for Unity.
图三
图四
打开Unity——Editor—— Preferences——External Tools —— External Script Editor选择对应VS,并且Editor Attaching勾选上.如下图所示

图五
以下解决方案均在通用步骤完成后才能进行.
解决方案一:
VS菜单栏—调试选项—附加到Unity程序调试—选择对应设备
解决方案二(推荐):
将Visual Studio 2017 Tools.unitypackage 导入Unity.文件位置如下
C:\Program Files (x86)\Microsoft Visual Studio Tools for Unity\15.0 
关闭重新启动Unity和VS即可.(查看)
总结
保持饥饿,保持愚蠢.
这世界唯一能够相信的就是你付出的努力和你走过的路.
边栏推荐
- SecureCRT garbled code solution [easy to understand]
- [advanced mathematics] [5] definite integral and its application
- Step num problem
- Chinese son-in-law OTA Ono became the first Asian president of the University of Michigan, with an annual salary of more than 6.5 million!
- 毕业从事弱电3个月,我为什么会选择转行网络工程师
- 103. (cesium chapter) cesium honeycomb diagram (square)
- 使用cookie登录百度网盘(网站使用cookie)
- [onnx] export pytorch model to onnx format: support multi parameter and dynamic input
- Formatdatetime explanation [easy to understand]
- securecrt乱码解决方法[通俗易懂]
猜你喜欢

Kubernetes进阶部分学习笔记

JVM (XXIII) -- JVM runtime parameters

103. (cesium chapter) cesium honeycomb diagram (square)

参与开源社区还有证书拿?

During the interview, I was asked how to remove the weight of MySQL, and who else wouldn't?

Online XML to JSON tool

Increase swap space
![[cloud native | learn kubernetes from scratch] VIII. Namespace resource quotas and labels](/img/7e/2bdead512ba5bf5ccd0830b0f9b0f2.png)
[cloud native | learn kubernetes from scratch] VIII. Namespace resource quotas and labels
![[today in history] July 15: Mozilla foundation was officially established; The first operation of Enigma cipher machine; Nintendo launches FC game console](/img/7d/7a01c8c6923077d6c201bf1ae02c8c.png)
[today in history] July 15: Mozilla foundation was officially established; The first operation of Enigma cipher machine; Nintendo launches FC game console
![[today in history] July 1: the father of time-sharing system was born; Alipay launched barcode payment; The first TV advertisement in the world](/img/41/76687ea13e1722654b235f2cfa66ce.png)
[today in history] July 1: the father of time-sharing system was born; Alipay launched barcode payment; The first TV advertisement in the world
随机推荐
ROS_ Rqt toolbox
Google guava is just a brother. What is the real king of caching? (glory Collection Edition)
SecureCRT garbled code solution [easy to understand]
[advanced mathematics] [5] definite integral and its application
网络RTK无人机上机测试[通俗易懂]
Myormframeworkjdbc review and problem analysis of user-defined persistence layer framework, and thought analysis of user-defined persistence layer framework
[noi simulation] string matching (suffix automata Sam, Mo team, block)
[today in history] July 15: Mozilla foundation was officially established; The first operation of Enigma cipher machine; Nintendo launches FC game console
[tensorrt] trtexec tool to engine
RF, gbdt, xgboost feature selection methods "recommended collection"
DIY个人服务器(diy存储服务器)
[cloud native | learn kubernetes from scratch] VIII. Namespace resource quotas and labels
Step num problem
What is cluster analysis? Categories of cluster analysis methods [easy to understand]
Summarize the level of intelligent manufacturing discussion [macro understanding]
Key network protocols in tcp/ip four layer model
[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay
Three skills of interface request merging, and the performance is directly exploded!
Recommended books | essentials of industrial digital transformation: methods and Practice
【云原生 | 从零开始学Kubernetes】八、命名空间资源配额以及标签