简体   繁体   English

当我通过统一打开 c# 脚本时,Visual Studio 没有给出提示(智能感知),

[英]Visual studio not giving Hints (intellisense) when i opening the c# scripts through unity,

I recently installed unity,but I didn't install visual studio with it because I already have installed.我最近安装了unity,但我没有安装Visual Studio,因为我已经安装了。 I simply opened unity and I goes to Edit > Preferences > External script editor and I selected Visual studio code.我只是打开了统一,然后转到编辑 > 首选项 > 外部脚本编辑器,然后选择了 Visual Studio 代码。 But when I opening my scripts, visual studio not giving hints for my c# code.但是当我打开我的脚本时,Visual Studio 没有提示我的 c# 代码。

unity Externals 工具 视觉工作室代码

You probably need to install the appropriate targeting pack for Unity.您可能需要为 Unity 安装适当的目标包 That article also has some other helpful extensions to install when developing in Unity.在 Unity 中开发时,该文章还有一些其他有用的扩展可供安装。

What you could do is just open it and close it.你能做的就是打开它然后关闭它。

What i mean by that is go to Assets > Open C# Project我的意思是 go 到资产 > 打开 C# 项目

Once VSCode opened, wait for 1 min, try to write something like Rigidbody . VSCode 打开后,等待 1 分钟,尝试编写类似Rigidbody的内容。 If intellisense is working it will start giving you hints, if it's still not working如果智能感知正常工作,它将开始给你提示,如果它仍然不工作

Do the process one more time,再做一遍这个过程,

You can refer to these pictures where how VSCode tells you whether Intellisense is working or not.您可以参考这些图片,其中 VSCode 如何告诉您 Intellisense 是否正常工作。 http://imgur.com/gallery/1YiuPA4 http://imgur.com/gallery/1YiuPA4

You need to install snippets for Unity in VS code.您需要在 VS 代码中安装 Unity 的代码片段。 Open VS code.打开 VS 代码。 Go to Extensions(ctrl+shift+X). Go 到扩展(ctrl+shift+X)。 In search field you need to write unity Then click to Unity Code Snippets and install it in window bellow.在搜索字段中,您需要编写 unity 然后单击 Unity Code Snippets 并将其安装在 window 中。 Then you will be able to see Intelesence !然后你就可以看到Intelesence了!

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

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