I have just begun trying to learn C# with Unity. I'm following guides and tutorials. In these guides I see auto completions that my visual studio code is not showing me.
For example, in one video I see the following auto-completion:
On my own installation, I see the following:
Note that the auto-completion is not hinting Destroy
. Other methods/functions such as GetComponent
are also not auto-completed.
I believe that the correct folder is opened in VSC.
Visual studio code is set as my default editor in unity as per this question . I have installed the .Net Core Extension Pack
, which includes the C# extension pack for VSC. What am I missing?
Enabling code completion (For recent versions of Unity)
If you are installing VS Code for the first time, you might be missing targeting packs required for Unity's code-completion (IntelliSense) in VS Code.
Targeting pack download links:
• Windows: .NET Framework 4.6 Targeting Pack
Download Link: https://www.microsoft.com/download/details.aspx?id=48136
• macOS: Download .NET SDK
Download link: https://dotnet.microsoft.com/download
Steps:
install emmet plugin and use ctrl+space keys for auto-completion
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.