- Home /
Reloading CSV File During Play
Part of Unity my project is real time data visualization. Currently I have my data being rewritten into a csv file every second.
For example, the file may read:
0,2,2,3
9,4,5,4
and a second later read:
0,3,4,3
2,3,3,4
I have scripts that can read and visualize the data from the csv file and they mostly run correctly. However, my scene only shows the new data and visualizations whenever I click out of Unity (i.e. to my desktop) and then click back in.
After debugging for a while, I believe my script is failing to reload the csv file until I click out and back in. Does anyone know a solution to force the reload?
Here is an example of my script:
void Start()
{
Load(file);
// Here are the Detector CountRates
CPS1 = float.Parse(Find_instrument(DetectorName1).grosscount, CultureInfo.InvariantCulture.NumberFormat);
}
void Update()
{
Load(file);
// Here are the Detector CountRates
CPS1 = float.Parse(Find_instrument(DetectorName1).grosscount, CultureInfo.InvariantCulture.NumberFormat);
}