Hi can’t make this to work:
Basically I am try to change the value of a slider when I load some value that I previously saved. I have tested the data and it works fine when reading it (the value is what is supposed to be) just does not update the position of the slider Please help!
public void Load()
{
if (File.Exists(Application.persistentDataPath + "/weatherInfo.dat"))
{
BinaryFormatter bf = new BinaryFormatter();
FileStream file = File.Open(Application.persistentDataPath + "/weatherInfo.dat", FileMode.Open);
WeatherData data = bf.Deserialize(file) as WeatherData;
file.Close();
DawnDuskSlider.value = data.hours;
Debug.Log("data in data is:" + data.hours);
Debug.Log("data in slider is:" + DawnDuskSlider.value);
}
}