윈도우용 유니티 에디터는 Visual Studio Community 가 기본 설정 C# 에디터이다. (유니티 엔진 설치 될 때 기본 체크되어있음)
하지만 VS Code 로 설정해도 상관 없다. Mac은 VS Code가 기본 설정 C# 에디터이다.
설정하기
유니티 쪽
1. 유니티 에디터 설치 시 'Visual Studio Community' 체크 해제. (윈도우 버전만)
2. 유니티 설치 후 에디터에서 Edit > Preferences > External Tools > External Script Editor 설정(VS Code)
(왜인지 모르게 설정이되어있음, 최초 스크립트 수정시 강제 설정해서 그런가?)
3. 밑에 Embedded packages, Local Packages, Registry Packages, Git packages 를 체크하고, Regenerate project files 클릭
4. 메뉴 Assets > Open C# Project => VS code가 열려야함.
VS Code 쪽
1. Extensions 에서 C# Dev Kit , C# , Unity 를 설치함.
2. 자동 완성 힌팅이 안될 경우, CS 파일 열 때 C# 에러 관련 토스트가 보일 경우 => dotnet sdk 가 설치 안됨.
dotnet-runtime-8.0.28-win-x64.exe 만 설치해서는 자동 완성 동작 안하더라.
dotnet 설치 확인
--------------------=-----------
C:\>dotnet
Usage: dotnet [path-to-application]
Usage: dotnet [commands]
path-to-application:
The path to an application .dll file to execute.
commands:
-h|--help Display help.
--info Display .NET information.
--list-runtimes [--arch <arch>] Display the installed runtimes matching the host or specified architecture. Example architectures: arm64, x64, x86.
--list-sdks [--arch <arch>] Display the installed SDKs matching the host or specified architecture. Example architectures: arm64, x64, x86.
-----------------=-----------------
이런 메세지가 아니라면 설치 안된 것임. 이 때 윈도우 10의 경우 설치 관련 안내 URL이 보일 수 있음