Visual studio code auto-complete

后端 未结 9 2278
遥遥无期
遥遥无期 2021-02-13 03:30

I have just downloaded unity and saw that now it supports Visual studio code, I downloaded it and made it the default editor.

After trying to edit a script, it prompted

相关标签:
9条回答
  • 2021-02-13 03:59

    Intellisense (Autocompletion) is a pure workflow of .Net Environment. So, you need to have .Net 'Developer pack' (not Runtime) installed on your system as it installs all three necessary components below:

    1. .Net framework
    2. .Net Target pack
    3. .net SDK

    reference link: https://dotnet.microsoft.com/download/visual-studio-sdks

    It is directly installed to a system admin-accessible path, so no need setting it up. Now, you have to tell VS Code which .Net version to use (whichever you have installed). Your Unity project will have these two files in the root directory:

    1. Assembly-CSharp.cs
    2. Assembly-CSharp-Editor.cs

    In these both files search for line (probably 16):

    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
    

    Edit version that you had just installed (I had 4.8). Then reopen VS Code. Now everything should work fine.

    0 讨论(0)
  • 2021-02-13 04:01

    The issue here is that you haven't selected VS as your code editor preference (https://docs.unity3d.com/Manual/Preferences.html) . Once you do this, also install the Game development with Unity workload for Visual Studio

    0 讨论(0)
  • 2021-02-13 04:02

    For new users who have the same requirement, I'll suggest you to switch to another IDE: Rider, provided by Jetbrains. It's just amazing and less cumbersome than VS Code.

    0 讨论(0)
提交回复
热议问题