光のカナダ留学blog

30歳で会社を退職。現在カナダ留学中です。

【Unity】Visual Studioのインテリセンス(自動補完や候補予測)が効かない場合の対処法

スポンサーリンク

UnityのスクリプトでVisual Studioを起動した際、インテリセンス(自動補完や候補予測)が働かない場合の対処法です。

External Script Editorの確認

There is no auto-completion because the script says "Miscellaneous Files" instead of the of the name of the Project. Take a look at the image below that came from the video in your question:

f:id:hikaruryugaku:20190211140950p:plain

引用:c# - Autocompletion not working in Visual studio - Stack Overflow

f:id:hikaruryugaku:20190211135204p:plain

スクリプトの赤くなっている所を確認して"Miscellaneous Files"と書かれている場合は、まずEdit>Preferences>External ToolsのExternal Script EditorにVisual Studioが選択されているかを確認します。

f:id:hikaruryugaku:20190211135447p:plain

もしリストにVisual Studioが無い場合、Visual Studio Installerを起動して、Game Development with Unityをインストールします(手順は下記にあります)。

Game Development with Unityのインストール

Visual Studio Installerを起動後、MoreのドロップダウンからModifyをクリック(Visual Studio 2017の場合)。

f:id:hikaruryugaku:20190211140048p:plain

 

WorkloadsタブのGame development with Unityのチェックを入れてModifyをクリックします。

f:id:hikaruryugaku:20190211140432p:plain

インストールが終わると、上で説明したExternal Script EditorからVisual Studioを選択できるようになるので選択します。以降、スクリプトを開くとインテリセンスが使えるようになります。

参考:Unity Visual Studio 2017 Setup & Tools - YouTube