I migrated a project to the 2021.3.8f1 and now I can’t make it work correctly for UWP!
When the program starts and calls PlayerPrefs.GetFloat() the return value is wrong.
For example, we save (with SetFloat) the number “1.47” and we get (with GetFloat) the number “1069334000”
This happens ONLY when the program starts. If during the execution we use SetFloat, then the GetFloat returns a correct value.
This happens only when running on UWP. Not on editor, not on Android, not on Windows, not on iOS.
I tried Unity versions 2021.3.8f1 and 2022.1.13f1
To test it I used this script
public class testGetFloat : MonoBehaviour
{
public TextMeshProUGUI t;
void Start()
{
float f = PlayerPrefs.GetFloat("xxx", 0.0f);
float r = Random.Range(-0.01f, 2f);
t.text = f.ToString("0.00") +" - "+ r.ToString("0.00");
PlayerPrefs.SetFloat("xxx", r);
}
}