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

New Private field method access issue [Workaround]

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
csharp, unity
領域
devtools, game-dev

調査の方向性

NewFieldsRewriterから始め、Unityのホットリロードワークフローで報告されたprivateフィールドへのアクセスケースを再現します。_instanceNewFieldへの直接アクセスとローカル変数を使った回避策を比較し、そのうえで、Gizmos.DrawWireSphere(_lastCamState.FinalPosition, BodyRadius)のような使用箇所が、構文のクリーンアップを必要とせず一貫して書き換えられることを確認します。

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

説明

workaround

Current Workaround

So it seems this is the workaround for now. Any direct access the new field breaks the rewritter.

_instanceNewField.DoesWhatYouWant(); //<- fails to rewrite
var myLocalNewField = _instanceNewField; // <- this gets correctly rewritten
myLocalNewField.DoesWhatYouWant(); //<- All good

Then on your next recompilation round you can clean up the syntax.

Issue

I'm not sure if it's a regression and what would be its reason, but most of the time nowadays adding private fields fails as they are not rewritten correctly in every places. Example bellow.
Added
private CameraState _lastCamState;

One of the correctly rewritten part I believe
FastScriptReload.Scripts.Runtime.TemporaryNewFieldValues.ResolvePatchedObject<Indus.Client.Cameras.CinemachineBodyCollider__Patched_>(this)._lastCamState = state;

Some other places not rewritten
Gizmos.DrawWireSphere(_lastCamState.FinalPosition, BodyRadius);

It is the NewFieldsRewriter job to perform the rewrite now not sure why it skip some cases.

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

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

handzlikchris/FastScriptReload のほかの issue

handzlikchris/FastScriptReload の issue をすべて見る

似ている issue

C# の issue をもっと見る

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

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