Unity 3DGameKit Project Migration could not find the type or namespace name 'Cinemachine' Is a using directive or assembly missing? Functional component configuration of vs2022 with unity

Problem Description:

Unity 报错 the type or namespace name ‘Timeline’ could not be found 

Recently, I encountered this pit when migrating a project. The version of unity is the same, but the editor VS Code is changed to VS 2019. The
code prompts of VS are still powerful , but the memory usage is too large. When migrating, the entire Assets is directly copied
(or use vscode, there is no unity smart code prompt problem has been solved, see this blog post by the blogger: The
latest version of vscode really solves the development with vscode + unity without code smart prompt OmniSharp service starts vscode debugging unity preparation )

untiy 3DGamekit/Packages/SceneManagement/Runtime/TransitionPoint.cs(1,7):
1:
The type or namespace name 'xxx' could not be found (are you missing a using directive or an assembly reference?)
2:
the type or namespace name ' Cinemachine could not be found

Stepping on the pit:

This is an error reported by official and third-party components. At first I thought it was an assembly problem, so I modified it.

1. Assembly-CSharp.csproj文件
 <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>为v4.5 和v3.5 无用
 网上说是要导入包的程序集,我也不知道是哪个啊,在VS工具功能扩展我是将4到4.6的都安装了
2. 由unity打开脚本,在vs里面打开dll窗口添加
发现该项目未正确加载VC++项目,对应的项目属性编辑窗口打不开,
而vs2019还有一个属性窗口,但也不是我们所需要的可以
修改编译输出dll路径和修改.net framework的地方

I remember that vs2017 does not have this problem~ > ~
Then I reinstalled vs2019
insert image description here
3. Unity downloads and automatically selects the corresponding functional components, but it still doesn’t work
4. I also tried the unity Package Manager and updated the vs editor, but it didn’t work
insert image description here

solve

I did not download 2017, but directly chose to download the latest version. The vs2022
problem seems to be solved? ? ?
After the project is compiled,
the top menu of unity automatically adds Cinemachine, Kit tools, etc.
insert image description here
The red color that starts to appear! The error message is different.
Update all the plugins of Package Manager, and the problem is solved.

insert image description here
What did I find? Cinemachine is a plug-in. The project itself is for learning the official 3D Game Kit development kit. I didn’t expect this. Didn’t it automatically [download] compile before? ? The /
vs2022 version can't right-click to open the project properties, and it passes by in a flash (a C# project or C++ project that may be created separately)

Attach the functional component configuration of vs2022 with unity:

insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/qq_44256828/article/details/126923412