DEV Community

KOGA Mitsuhiro
KOGA Mitsuhiro

Posted on • Originally published at qiita.com

Unity5.5とVSCode連携

趣味でUnityで遊んでいるのですが、Visual Studio 2015が重くて小さなコードを作るだけだとイライラしてしまいます。
そこで最近サポートが充実してきて動作も軽いVisual Studio Codeに切り替えてみました。

設定およびインストールしたもの

2016-12-18_14h53_37.png

  1. メニューのEdit -> Preferences...からUnity Preferencesダイアログを開きます
  2. External ToolsタブのExternal Script EditorのドロップダウンのBrowse...からVisual Studio Codeのパスを指定します
    • 初回はドロップダウンにVisual Studio Codeが無いのですが一度設定すると出てきます

※ Unity5.4以前ならUnity Visual Studio Code Integrationをプロジェクトに追加しないとうまく連携できないのですが、Unity5.5から同等の機能があるため追加不要です。

Visual Studio Codeの拡張

この辺りを入れておくと補完やデバッグできて便利です。

settings.json

フォーマッタは好みが分かれるところですが、改行したときと保存したときに自動適用することができます。

{
    // 行単位(エンターを押したとき)にフォーマットします。
    "editor.formatOnType": true,

    // ファイルを保存するときにフォーマットします。
    "editor.formatOnSave": true
}
Enter fullscreen mode Exit fullscreen mode

それ以外

上記の拡張を入れるとVisual Studio CodeにGet Toolsボタンが表示されるので、そこから.NET Core Toolsをダウンロードしてインストールします。

以上でVisual Studio Codeでも便利な環境のできあがりです。

参考リンク

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay