Unity Scripts edited in Visual studio don't provide autocomplete

前端 未结 26 1790
半阙折子戏
半阙折子戏 2020-11-22 10:02

When I want to edit C# Unity scripts, they open in Visual Studio. It is supposed to provide auto complete for all Unity related code, but it doesn\'t work.

Here you c

26条回答
  •  耶瑟儿~
    2020-11-22 10:23

    The issue I faced was that the C# Project was targeting a different .NET Framework (4.7.2), whereas the Unity project had a different target (.NET 3.5).

    I fixed this by changing the target in Unity as-

    File -> Build Settings -> Player Settings -> Other Settings -> API Compatibility Level : Set it to the .NET version you already have installed (Check your .NET Version here). In my case, it was 4.x

    After this, Visual Studio worked perfectly and autocorrect was fixed too.

提交回复
热议问题