コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】Rider で Assembly Definition File を作成する時のファイルテンプレートを差し替える

概要 { "name": "$NAME$" } Rider の Assembly Definition File のファイルテンプレートは上記のように 名前だけを保持する形式になっているので各種パラメータを保持する形式に変更した Rider の設定で「ファイル | 設定 | エディター | ファイルテンプレー…

【Unity】Rider から Unity のアセットを手動でリフレッシュする方法

概要 公式ドキュメントの上記のページに記載されています この記事では Rider の新しい UI での手順を書き残しておきます Rider の Unity のツールバーを右クリックして「ツールバーのカスタマイズ」を選択して 「+」を押して 「アクションの追加」を押して …

【Rider】フィールド名を変更した時に FormerlySerializedAs が付与されないようにする方法

概要 JetBrains Rider を 2023.1.1 にアップデートしたら フィールド名を変更した時に FormerlySerializedAs が自動で付与されるようになった Preferences を開いて「言語 & フレームワーク > Unity エンジン」の 「シリアル化されたフィールドの名前を変更…

【Rider】Explorer でファイルを選択した状態で Find in Files を開くと検索範囲が自動で「Directory」になる

概要 ファイル検索しても意図した結果にならないので調べてみたところ いつの間にか検索範囲が「Directory」になっていた Explorer でファイルを選択した状態で Find in Files を開くと 検索範囲が自動で「Directory」になり、 次に検索する時は前回選択され…

【Rider】Loading solution がいつまで経っても完了しない場合

概要 「Loading solution」や「Cache processing」「Updating indexes」が いつまで経っても完了しない現象に遭遇した Rider を再起動しても解決しなかった Mac を再起動したら数秒で完了した

【Rider】タイトルバーの色を変更できる「Project-Color」紹介

はじめに 「Project-Color」を Rider に導入することで タイトルバーの色を変更できるようになります 使い方 ツールバーのアイコンを押して 色を選択することでタイトルバーの色を変更できます 「Automatically set color based on project name」をオンにす…

【Unity】IDisposable.Dispose し忘れてる場合に Rider で警告の線を表示する方法

概要 上記のページを開いて「Download package」を押して ダウンロードした .nupkg を ZIP で展開して、展開したフォルダ内の 「analyzers\dotnet\cs\IDisposableAnalyzers.dll」を Unity プロジェクトに追加して すべてのチェックを外して「Apply」を押して…

【Rider】Unity の .asmdef を Reformat and Cleanup した時にインデントの幅を 4 で保持する方法

概要 .asmdef を Reformat and Cleanup する時は JSON のコードスタイルの設定が適用されるので 「Editor > Code Style > JSON」の「Tabs and Indents」の 「Indent」を「4」にすると .asmdef のインデントの幅を 4 で保持できる

【Rider】ファイルの変更を保存した時にコードクリーンアップを自動的に実行する方法

概要 「Tools > Actions on Save」の「Reformat and Cleanup Code」をオンにする

【Rider】Mac でグローバル設定のファイル(GlobalSettingsStorage.DotSettings)がマニュアルに記載されている場所とは別の場所に保存されていた

概要 ~/Library/Preferences/RiderXXX/config/resharper-host/GlobalSettingsStorage.DotSettings マニュアルには上記の場所に保存されていると記載されていたが ~/Library/Application Support/JetBrains/Rider2021.3/resharper-host/GlobalSettingsStorage…

【Rider】折り返し(ソフトラップ)を無効化する方法

概要 Rider メニューの「View > Active Editor > Soft-Wrap」をオフにする

【Rider】Application のコード補完から UnityEngine.WSA.Application を非表示にする方法

概要 UnityEngine.WSA.Application Auto Import に上記の文字列を追加する

【Rider】Random のコード補完から Unity.Mathematics.Random を非表示にする方法

概要 Unity.Mathematics.Random Auto Import に上記の文字列を追加する

【Rider】Array のコード補完から NPOI.HPSF.Array を非表示にする方法

概要 NPOI.HPSF.Array Auto Import に上記の文字列を追加する

【Rider】Assembly のコード補完から UnityEditor.Compilation.Assembly を非表示にする方法

概要 UnityEditor.Compilation.Assembly Auto Import に上記の文字列を追加する

【Rider】Task のコード補完から UnityEditor.VersionControl.Task を非表示にする方法

概要 UnityEditor.VersionControl.Task Auto Import に上記の文字列を追加する

【Rider】Type のコード補完から Mono.CompilerServices.SymbolWriter.CodeBlockEntry.Type を非表示にする方法

概要 Mono.CompilerServices.SymbolWriter.CodeBlockEntry* Auto Import に上記の文字列を追加する

【Rider】Path のコード補完から DG.Tweening.Plugins.Core.PathCore.Path を非表示にする方法

概要 DG.Tweening.Plugins.Core.PathCore* Auto Import に上記の文字列を追加する

【Rider】NotNull のコード補完から System.Diagnostics.CodeAnalysis.NotNullAttribute を非表示にする方法

概要 System.Diagnostics.CodeAnalysis.NotNullAttribute Auto Import に上記の文字列を追加する

【Unity】string.IsNullOrWhiteSpace を簡単に書けるようにするソーステンプレート

ソースコード [SourceTemplate] public static void isnullorwhitespace( this string self ) { /*$ string.IsNullOrWhiteSpace( str ) */ }

【Unity】string.IsNullOrEmpty を簡単に書けるようにするソーステンプレート

ソースコード [SourceTemplate] public static void isnullorempty( this string self ) { /*$ string.IsNullOrEmpty( str ) */ }

【Rider】Vector3 のコード補完から System.Numerics.Vector3 を非表示にする方法

概要 System.Numerics* Auto Import に上記の文字列を追加する

【Rider】コード補完から UnityEngine.Windows を非表示にする方法

概要 UnityEngine.Windows* Auto Import に上記の文字列を追加する

【Rider】Directory のコード補完から UnityEngine.Windows.Directory を非表示にする方法

概要 UnityEngine.Windows.Directory Auto Import に上記の文字列を追加する

【Rider】File のコード補完から System.Net.WebRequestMethods.File と UnityEngine.Windows.File を非表示にする方法

概要 System.Net.WebRequestMethods* UnityEngine.Windows.File Auto Import に上記の文字列を追加する

【Rider】Image のコード補完から MG.GIF.Image を非表示にする方法

概要 MG.GIF.Image Auto Import に上記の文字列を追加する

【Rider】Type のコード補完から UnityEngine.ADBannerView と UnityEngine.iOS.ADBannerView を非表示にする方法

概要 Auto Import の一覧に以下の 2 つを追加する UnityEngine.ADBannerView* UnityEngine.iOS.ADBannerView*

【Rider】XML ドキュメントコメントの summary のみを入力できる Live Template

概要 Rider の Preferences の「Editor > Live Templates > C#」を選択して 「New Template」のアイコンを押して 「Shortcut:」に summaryComment と入力して左のテキストエリアに /// <summary> /// $END$ /// </summary> と入力して保存する 設定

【Unity】string.Join を簡単に書けるようにするソーステンプレート

ソースコード #if UNITY_EDITOR using System; using System.Collections.Generic; using JetBrains.Annotations; // ReSharper disable IdentifierTypo // ReSharper disable InconsistentNaming namespace Kogane { [PublicAPI] [Obsolete( "", true )] pu…

【Unity】Debug.Log を簡単に書けるようにするソーステンプレート

ソースコード #if UNITY_EDITOR using System; using JetBrains.Annotations; // ReSharper disable IdentifierTypo // ReSharper disable InconsistentNaming namespace Kogane { [PublicAPI] [Obsolete( "", true )] public static class SourceTemplateCo…