如何在Visual Studio Code for Unity函数名称中获取智能感知?

问题描述:

我正在关注有关Unity的教程,我发现讲师在编写方法名称时具有智识.

I am following a tutorial about Unity and I see that the instructor has intellisense when writes the method's name.

但是,我只具有类和变量的智能感知能力,我的意思是Unity类,例如Rigidbody和我自己的变量.

However I have only intellisense with classes and variables, I mean Unity classes like Rigidbody and my own variables.

我也读过: 自动补全在Visual Studio中不起作用

如何在Visual Studio 2017中启用智能感知团结

老问题,但最近我也遇到了同样的问题.

Old question, but I had the same problem just recently.

您的 Assembly-CSharp.csproj project-name.sln 文件中肯定存在问题.最可能是 .csproj 文件.如果您看一下它,将会看到对.dll文件的各种引用.

There must have been an issue in your Assembly-CSharp.csproj or project-name.sln files. Most likely to be the .csproj file. If you take a look at it, you will see various references to .dll files.

您可以通过启用编辑">首选项">生成所有.csproj文件",告诉Unity(我的版本: v2019.2.20f1 )为您创建这些文件.

You can tell Unity (my version: v2019.2.20f1) to create these for you by enabling Edit > Preferences > Generate all .csproj files.

 1. Delete both files.
 2. Enable .csproj file generation.
 3. Double click on a script in Unity.

这解决了我的问题.