Last Updated on 2021-10-25 by Clay
Problem
Over the years, I have installed Unity and Visual Studio on different devices and operating systems to make games, but this time, I actually encountered that Visual Studio cloud not automatically complete Unity-related modules and functions problem.
Maybe someone will suggest: automatic completion? Not required! I'll remember the function names for a long time.
Of course we can do that, and search the problem we encountered on Internet, but the efficiency of programming in this way is not as efficient as having IDE assist.
Fortunately, this problem is not difficult to solve.
Solutions
Solution 1: Change Unity Settings
Edit > Preferences... > External Tools > External Script Editor (the first line) > Change "Open by file extension" to "Visual Studio".
And we need to restart Visual Studio can confirm does it auto complete the Unity-related code.
Solution 2: Restart Visual Studio Installer
Execute Visual Studio Installer, confirm there is Unity 3D C#, it is the default setting.
References
- https://code.visualstudio.com/docs/other/unity
- https://stackoverflow.com/questions/40983371/visual-studio-code-auto-complete
It works 100%, thx dude.
Glad to hear such a message!
I tried all methods but yours is the one that worked out, Thanks