Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Improvement: FindFileOrThrow for dotnet tools caching result between project sessions

オープン
#171 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp, unity
領域
game-dev, tooling

調査の方向性

FindFileOrThrow の実装を特定し、SessionState が現在どのように結果を保存しているかを確認します。キャッシュが Unity のバージョン単位でスコープされ、存在しないパスを無効化し、プロジェクトを再度開いた後の深い検索を回避することを検証します。初回起動と、その後のプロジェクトセッションを手動でテストします。

索引モデルが issue の本文から書いたものです。

説明

Hi, handzlikchris. Thank you for your excellent work.

I noticed that every time project opens, FSR always search deeply into Unity installation path for dotnet tools, which spends seconds to complete. Because of storing in SessionState, first-time project launch can't benefit from it.

In my opinion, utilize EditorPrefs with unityVersion could be better.

Here is my snippet for this:

private static string FindFileOrThrow(string fileName)
{
    var cacheKey = $"FSR:FilePath_{fileName}:{Application.unityVersion}";
    var result = EditorPrefs.GetString(cacheKey, null);

    if (result != null && !File.Exists(result))
    {
        EditorPrefs.DeleteKey(cacheKey);
        result = null;
    }

    if (result == null)
    {
        result = Directory
            .GetFiles(ApplicationContentsPath, fileName, SearchOption.AllDirectories)
            .FirstOrDefault();

        if (result == null)
        {
            throw new Exception($"Unable to find '{fileName}', make sure Editor version supports it. You can also add preprocessor directive 'FastScriptReload_CompileViaMCS' which will use Mono compiler instead");
        }
    }

    EditorPrefs.SetString(cacheKey, result);
    return result;
}

主要言語
C#
スター
2.2k
フォーク
169
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

handzlikchris/FastScriptReload のほかの issue

handzlikchris/FastScriptReload の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。