Thank you both so much @derHugo and @Gerry Schmitz! Combining your suggestions (saving at periodic intervals and not only exporting at OnApplicationQuit allowed me to get the CSVs saved as intended!
In case anyone else has a similar issue in the future, I added in the following lines to my code to get it to work as intended:
Before void Start():
public float saveIntervalInSeconds = 15.0f; // logs the data every 15 seconds; adjustable in Inspector
At the end of void Start() (after dataLines.Add):
StartCoroutine(SaveRoutine());
Between voidRecordData() and void OnApplicationQuit():
private System.Collections.IEnumerator SaveRoutine()
{
while (true)
{
yield return new WaitForSeconds(saveIntervalInSeconds);
SaveData();
}
}
I kept the OnApplicationQuit export point just as a final export point, to try to cover any data that may not have been exported in the smaller intervals.