handzlikchris / handzlikchris/FastScriptReload
Swapping the order of field declarations lead to an unexpected results.
- Lenguaje dominante
- C#
- Estrellas
- 2.2k
- Forks
- 167
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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).
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Reproduce the issue in Unity with the C# script and swapped field declarations shown in the report. Inspect the hot-reload field restoration path, focusing on whether fields are matched by declaration order; done means reloading preserves i1 as 1 and does not interpret i2's bits as an integer.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp, unity
- Área
- devtools, game-dev
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100