使い方

ドキュメント:

Unity Development with VSCode | Visual Studio Code [Official]

参考:

Unity で Visual Studio Code を使用できるようにするまでの手順 – Qiita

Unity と VScode で開発するための環境構築 – Qiita

今日から Unity + Visual Studio Code を用いた快適な開発生活 – Qiita

Unity での VSCode の導入手順とおすすめ設定/拡張機能 – Qiita

Unity × VSCode で爆速コーディング – Qiita

Unity のエディタを VSCodeに 設定する8つの手順 | Sheep tech note

Unity + VSCode の環境構築 | Shinonome Tech Blog

Unity で VSCode を使うためのセットアップ手順 | lisz-works

Unity から VSCode で C# プロジェクトを開く設定 | lisz-works

Unity + VSCode で快適な開発環境を作る | Nodachisoft

VSCode で C# 開発環境整えちゃう/グッバイ Visual Studio | ASCII.jp

Unity のデフォルトエディタを VSCode に変える方法 | Unity Beginner

Roslyn

ドキュメント:

Enabling Unity Warnings | Visual Studio Code [Official]

Configuration Options – OmniSharp/omnisharp-roslyn Wiki – GitHub

Editor Config

参考:

Editor Config for VSCode を使って Unity C# のコードを整える | デニッキ!

拡張機能

参考:

Unity Extensions | Documentation for Visual Studio Code [Official]

.NET フレームワーク

.NET Framework 4.7.1

If you are installing VS Code for the first time, you might be missing targeting packs required for Unity’s code-completion (IntelliSense) in VS Code.

—— Visual Studio Code

入手:

ダウンロード – .NET Framework | Microsoft [公式]

ドキュメント:

開発者向けの .NET Framework のインストール | Microsoft Learn [公式]

Enabling Code Completion for Recent Versions of Unity | Visual Studio Code [Official]

参考:

Unity + VSCodeで「The reference assemblies for framework “.NETFramework,Version=*” were not found.」を解決する – Qiita

Unity 2018.2 で「C# プロジェクト “Assembly-Csharp” は、このコンピューターにインストールされていない」が出たので、その対処 | テラシュールブログ

Error: .NETFramework,Version=v4.7.1 の参照アセンブリが見つかりませんでした。の解決策 | siun のメモ

Visual Studio Code で「フレームワーク “.NETFramework,Version=v4.5” の参照アセンブリが見つかりませんでした。」と表示される時の対処方法 | ニワトリ再生産

New Unity 2018.3 and OmniSharp in VS Code error. · Issue #115 · Unity-Technologies/vscode-unity-debug – GitHub

Build Tools

Build Tools for Visual Studio 2022

The C# extension no longer ships with Microsoft Build Tools so they must be installed manually.

Download the Build Tools for Visual Studio 2022.
Install the .NET desktop build tools workload. No other components are required.

—— Visual Studio Code

入手:

Build Tools for Visual Studio 2022 – Download | Microsoft [公式]

ドキュメント:

Install Build Tools for Visual Studio | Visual Studio Code [Official]

Mac

参考:

Mac で VSCode がうまく Unity のコードを補完してくれないとき – Qiita

Unity 2018.2 で Mac の VSCode が入力補完してくれなくなった時の対処 | テラシュールブログ

Mono を認識せず、インテリセンスが消えたときの対処法 | Leaf

Omnisharp Update – Unable to find Mono. Ensure that Mono’s ‘/bin’ folder is added to your environment’s PATH variable. · Issue #4489 · OmniSharp/omnisharp-vscode – GitHub

VSCode can’t find Mono for OmniSharp – Stack Overflow

useModernNet

v1.25.0 has shipped with this change. A .NET 6 SDK is required when running with “omnisharp.useModernNet” set to “true”, which is the default configuration.

—— Joe Robich

TL;DR

  • ensure .NET SDK 6 is installed
  • for .NET Core (and newer) development this should be enough
  • for Unity / .NET Framework development, set “omnisharp.useModernNet” : false and ensure global MSBuild is installed on your machine – either using VS 2022 Build Tools (Windows) or using latest Mono Preview (*nix)

—— filipw

参考:

How to Fix IntelliSense and Symbols in VSCode for Unity C# Scripts | inspirnathan

v1.25.0 C# extension not working – Unity 2021 & 2020 · Issue #5252 · OmniSharp/omnisharp-vscode – GitHub

Update to 1.25.0. I can’t use F12,and check reference in Unity C# project. · Issue #5231 · OmniSharp/omnisharp-vscode – GitHub

Visual Studio Code Editor パッケージ

Unity 2019.2 以降で VSCode と連携するには、プロジェクトファイル (.csproj)、及び、ソリューション (.sln) を生成するために「Visual Studio Code Editor」パッケージがインストールされている必要がある。

Since 2019.2, it is required to use the Visual Studio Code Editor package. The built-in support for opening scripts from Unity and getting csproj and sln files generated has been removed.

—— Visual Studio Code

ドキュメント:

Visual Studio Code Editor | Unity Manual [Official]

Unity Version 2019.2 or Above | Visual Studio Code [Official]

リポジトリ:

Unity-Technologies/com.unity.ide.vscode: Code Editor Integration for VSCode – GitHub

wackoisgod/com.unity.ide.vscode at sdk-style-support – GitHub

wackoisgod/com.unity.ide.vscode at next/master – GitHub

参考:

Update on the Visual Studio Code package – Unity Forum

Support for legacy-style C# projects will be dropped by OmniSharp (and newer format is not used even if project is set to use .NET Standard 2.0) · Issue #19 · Unity-Technologies/com.unity.ide.vscode – GitHub

シンボルが認識されない

現象:

環境は設定済みで拡張は動作しているが、シンボルが認識されない。

対処法:

メニューから「Edit > Preferences」を開き、「External Tools」タブに切り替えて、「Regenerate Projects Files」ボタンを押して、プロジェクトファイルを再生成する。

また、VSCode あるいは、OmniSharp の再起動が必要な場合がある。

ドキュメント:

I don’t have IntelliSense | Visual Studio Code [Official]

参考:

No symbol information for the file – Qiita

Visual Studio Code でアウトラインが表示されなくなったときの対処 | ものづくりログ

Intellisense Not Working with Visual Studio – Unity Forum

“No symbols found in document” for listed file in project · Issue #5051 · OmniSharp/omnisharp-vscode – GitHub

ドキュメント

統合開発環境サポート | Unity マニュアル [公式]

Debug C# Code in Unity | Unity マニュアル [公式]

Roslyn Analyzers and Source Generators | Unity マニュアル [公式]

チュートリアル

How to Set Up Visual Studio Code for Unity (Zigurous)

How to Set Up Auto Complete (Tech Mammal)

C# Support

入手:

C# | Visual Studio Marketplace [Official]

リポジトリ:

OmniSharp/omnisharp-vscode: Official C# Support for Visual Studio Code – GitHub

ドキュメント:

C# Programming | Visual Studio Code [Official]

参考:

OmniSharp regularly “loses” Mono path, only solvable by restart of both VS Code and Unity · Issue #5259 · OmniSharp/omnisharp-vscode – GitHub

Announcement: Planned removal of the included Mono & MSBuild tools · Issue #5120 · OmniSharp/omnisharp-vscode – GitHub

Unity Code Snippets

入手:

Unity Code Snippets | Visual Studio Marketplace [Official]

参考:

Unity Code Snippets – Unity 関連のスニペットを使えるようにする | コガネブログ

Debugger for Unity

**DEPRECATED**

We understand that VS Code is appreciated, but on Unity side, we have nobody allocated on maintaining this extension as it would require at least 3+ folks fulltime to do it. Both VS and Rider are fully supported commercial solutions and we advice our users to switch to these solutions.

We will announce the deprecation of these extensions (this one and com.unity.ide.vscode). As this repository is provided with a permissive MIT license, it will be possible for the community to fork it and maintain it.

—— xoofx

入手:

Debugger for Unity | Visual Studio Marketplace [Official]

リポジトリ:

Unity-Technologies/vscode-unity-debug: Unity Debugging Support for VSCode – GitHub

ドキュメント:

Debugging | Visual Studio Code [Official]

参考:

Debugger for Unity – Unity をデバッグできるようにする拡張機能 | コガネブログ

VSCode で Unity をデバッグする方法 – Qiita

VSCode で Unity のデバッグが出来なくてハマったのを解決したメモ | Rinne

Debugger for Unity が非推奨になっている件と乗り換え先 | 御幸備忘録

Doesn’t create launch.json when selected as the task · Issue #194 · Unity-Technologies/vscode-unity-debug – GitHub

Extension deprecated? · Issue #206 · Unity-Technologies/vscode-unity-debug – GitHub

Unity extension is deprecated · Issue #5360 · microsoft/vscode-docs – GitHub

VSCode

**UNMAINTAINED**

動画:

How to Use

入手:

VSCode | Unity Asset Store [Official]

リポジトリ:

dotBunny/VSCode: Unity Visual Studio Code Integration – GitHub

Mono Debug

入手:

Mono Debug | Visual Studio Marketplace [Official]

リポジトリ:

microsoft/vscode-mono-debug: A Simple VSCode Debug Adapter for Mono – GitHub

Shaderlab VSCode

Free Version
  • Syntax Highlighting
  • Basic Code Completion
  • Signature Help
  • Path Intellisense
Paid Version
  • Intellisense
  • Code Snippets
  • Format Document and Selection
  • Hover Information
  • Document Symbols
  • Go To Definition
  • SRP Support

動画:

Demo

入手:

ShaderlabVSCode Free | Visual Studio Marketplace [Official]

ShaderlabVSCode | Unity Asset Store [Official]

ドキュメント:

Documents – ShaderlabVSCode | Amlovey [Official]

フォーラム:

ShaderlabVSCode – VSCode e\Extensions for Unity Shaderlab Programming | Unity Forum

参考:

Features – ShaderlabVSCode Documents | Amlovey [Official]

NuGet Importer for Unity

リポジトリ:

kumaS-nu/NuGet-importer-for-Unity – GitHub

参考:

Support SDK-style projects · Issue #38 · kumaS-nu/NuGet-importer-for-Unity – GitHub

記事をシェアする:
タグ:

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

Protected by reCAPTCHA