Writing to .txt file in Unity

The current Unity3D version of emotivear study program stores the user data to a .txt file. The benefits of this kind of approach are, for example, the possibility:

  • to store user data digitally and use it in Excel format fast (compared to paper study format)
  • to store the data accordingly during the study.
  • for user to be immersed to a study environment during the whole study
// This code is used by Juho Kastemaa in the MCSFemale Study of Emotions. 
// This writes a data.txt file in the ASSETS folder if it doesn't exist.
// Then it writes the answers. See Unity3D GUI.

public class CreateAFile : MonoBehaviour {...
// Created the filepath C# class from MS 

Link to the Class: https://msdn.microsoft.com/en-us/library/system.io.file(v=vs.110).aspx

Thank you for Niklas: http://nblomqvist.com/ who did his Master’s thesis using similar method and thank for lingoded Dev Dude to helping me with technological script in storing Character PreFabs to a Unity GUI list. This helped me to switch between multiple characters in a study.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s