iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🎮

Setting up Unity Development Environment with VSCode on M3 Mac

に公開

When I purchased a MacBook Air M3 and set up the Unity development environment, I encountered a few stumbling points such as errors. I am recording the setup procedure here.

Development Environment

  • MacBook Air 13 2024 (M3)
  • Unity 2021.3.44f1

Environment Setup

Install Visual Studio Code

Install Visual Studio Code.
https://code.visualstudio.com/#alt-downloads

For Silicon Macs equipped with M1 or M2, download the Apple Silicon version.

Install the Unity Extension in Visual Studio Code

To develop for Unity in Visual Studio Code, install the following extension:
https://marketplace.visualstudio.com/items?itemName=VisualStudioToolsForUnity.vstuc
Search for it within the VS Code extensions view or install it using the Install button on the link above.


At this time, dependencies such as the .NET Install Tool and C# Dev Kit extensions will be installed automatically.

Installing .NET 8 SDK

Since the Unity extension for Visual Studio Code depends on .NET 8 SDK or higher, install the .NET 8 SDK.
https://dotnet.microsoft.com/en-us/download

Download and install the .NET 8 SDK for Arm64 (Apple Silicon) from the link above.

Installing the Package from Unity's Package Manager

Open the Package Manager from Window/Package Manager, set the search target to Unity Registry, and search for the Visual Studio Editor extension.

Select and install Visual Studio Editor instead of Visual Studio Code Editor.

Since version 2.0.20 or higher is required, if it is already installed, check the version just in case and update if necessary.

Changing Unity Editor Settings

Change the editor settings used in Unity under Unity/Settings/Preferences/External Tools.
In External Script Editor, select Visual Studio Code.

Next, click Regenerate project files to generate the project files for VS Code.

Closing the running Visual Studio Code

You might have seen error messages like ".NET Core SDK not found" or "Failed to find dotnet info from path" in Visual Studio Code while setting up the environment.
Quit Visual Studio Code completely with Cmd+Q once, and then reopen it.

Now, you can develop for Unity using VS Code.

Discussion