简体   繁体   English

如何为现有的Unity项目设置Visual Studio?

[英]How to setup Visual Studio for existing Unity project?

I have cloned an existing Unity project from git on a new machine, and the source does not include *.sln or *.csproj . 我已经在新机器上从git克隆了现有的Unity项目,并且源代码不包含*.sln*.csproj

I have also downloaded Visual Studio from Unity Hub, but the editor doesn't work with Unity: 我还从Unity Hub下载了Visual Studio,但编辑器不能与Unity一起使用:

  1. VS doesn't recognize Unity components VS无法识别Unity组件
  2. Unity doesn't update VS project (new scripts not recognized in VS) Unity不更新VS项目(VS中无法识别的新脚本)

在此输入图像描述

I have selected VS as external tool for Unity, as shown here: 我选择VS作为Unity的外部工具,如下所示:

在此输入图像描述

I also installed anything VS suggests (Mono, and a few plugins, etc). 我还安装了任何VS建议(Mono,以及一些插件等)。 What's still missing? 什么仍然缺少?

The VS version is 7.7.4 and Unity is 2019.02 VS版本是7.7.4,Unity是2019.02

Problem fixed when I happened to re-open the project inside Unity: 当我碰巧在Unity中重新打开项目时问题得到解决:

Asset > Open C# Project 资产>打开C#项目

References: 参考文献:

  1. Autocompletion not working in Visual studio 自动完成在Visual Studio中不起作用
  2. https://answers.unity.com/questions/1451377/autocomplete-in-visual-studio-wont-work-please-hel.html https://answers.unity.com/questions/1451377/autocomplete-in-visual-studio-wont-work-please-hel.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM