handzlikchris / handzlikchris/FastScriptReload
Swapping the order of field declarations lead to an unexpected results.
- 主要言語
- C#
- スター
- 2.2k
- フォーク
- 167
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
When script
``` C#
using System.Collections;
using System.Collections.Generic;
using Unity.Mathematics;
using UnityEngine;
public class Test : MonoBehaviour
{
int i1;
float i2;
void Start()
{
i1 = 1;
i2 = 1.5f;
}
void Update()
{
Debug.Log(i1);
}
}
```
swap the declaration positions of i1 and i2 and reload to
``` C#
using System.Collections;
using System.Collections.Generic;
using Unity.Mathematics;
using UnityEngine;
public class Test : MonoBehaviour
{
float i2;
int i1;
void Start()
{
i1 = 1;
i2 = 1.5f;
}
void Update()
{
Debug.Log(i1);
}
}
```
expected output was 1, but the actual output was 1069547520 (this is the value of a 1.5 as an integer in binary).
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
レポートに示されている C# スクリプトとフィールド宣言を入れ替えた状態を使って、Unity で問題を再現します。ホットリロード時のフィールド復元パスを調査し、フィールドが宣言順で対応付けられているかどうかに重点を置きます。再読み込み後も i1 が 1 として保持され、i2 のビットが整数として解釈されなければ完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- csharp, unity
- 領域
- devtools, game-dev
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100