Open12

UnityとRiderメモ

s_ryuukis_ryuuki

保存時にリフォーマット
プロジェクトを開いていないと設定できない。

下記の設定にする。
Tools → Actions on Save → ✅Reformat and Cleanup Code
Profile: Reformat Code
Whoie file

s_ryuukis_ryuuki

Unityのスクリプトエディタ設定を変更

External Tools → External Script Editor → Rider 20xx.x.x
必要に応じて、「Generate .csprojfiles for:」を設定する。

s_ryuukis_ryuuki

Riderで編集しても、Unity再生中の場合にリロードしないようにする設定

Asset Pipeline → Auto Refres → Enabled Outside Playmode
Unity再生 → Riderで編集 → Unity停止(このタイミングではリロードしない)→Rider表示 → Unity表示でリロードする

Unity Issue Tracker - The “Recompile After Finished Playing” option is missing when choosing the "Script Changes While Playing" preference

  • This features has been depricated due to it not working as intented. It has been replaced with a new auto refresh feature in Preferences -> Asserts Pipeline -> Enabled Outside Playmode

Unityでエディター再生中にプログラムを変更してもコンパイルされないようにする - MRが楽しい

  • Recompile After Finished Playingが廃止されたため
s_ryuukis_ryuuki

2個エラーが発生している行の横に表示するプラグインがある。

Rider 2024.2.7で確認
Inspection Lens Plugin for JetBrains IDEs | JetBrains Marketplace

Windows版、Mac版共に日本語でも表示できる。(Version 1.4.1)


Rider 2024.2.4で確認
InlineError Plugin for JetBrains IDEs | JetBrains Marketplace

Mac版は日本語でも表示できる。(Version 0.4.0では、Windowsは文字化けする)
JetBrains IDEの日本語化 | 株式会社サムライズム

s_ryuukis_ryuuki

Riderで無料プランのGitHub Copilotが使用できるようになった。
Free Plan Support for GitHub Copilot Available on JetBrains IDEs - Microsoft for Java Developers

先にCopilot SettingsからCopilot無料版に登録しておくと認証を複数回行う必要がないはず。

上部のメニューからJetBrains Rider→Settings→Pluginを選択する。
Marketplaceタブを選択する。
検索窓に"GitHub Copilot”を入力して検索する。
"GitHub Copilot”を選択して、Installボタンを押す。

Riderで適当なプロジェクトを開く。
右側の"GitHub Copilot Caht"を押す。
"Sign in to GitHub"を押す。

Sin in To GitHubダイアログの"Copy and Open"を押す。

GitHubのページが開く。
Continueボタンを押す。

Cntl+Vでコードを貼る。("Copy and Open"の時にコードを取得している)
Continueボタンを押す。

"Authorize GitHub Copilot Plugin"ボタンを押す。

"GitHub Copilot”をEnableにしていたいのでステータスが足りていないためこのダイアログが出る。
"Signup"ボタンを押す。

Start usring Copilot Freeを押す。
チャット画面に切り替わる。

Riderを再起動する。
右側の"GitHub Copilot Caht"を押す。
"Authorize"を押す。

Githubの認証をやり直す。(手前の手順と同じためキャプチャー省略)
Chatの画面が⇩のようになれば成功。
コード補完ができるか試すこともできる。()

full line code completion機能はOFFになるので注意!