Exemplo n.º 1
0
    protected static void SaveLogs()
    {
        GazeAwareObject.SaveLogs();
        if (!Directory.Exists(directory))
        {
            Directory.CreateDirectory(directory);
        }

        directory += "/";

        string fileLocation = directory + fileName;

        // Create new file / delete preexisting one.
        if (File.Exists(fileLocation))
        {
            File.Delete(fileLocation);
        }

        // Write headers
        using (StreamWriter writer = File.AppendText(fileLocation))
        {
            writer.WriteLine(headers);
        }

        // Write each entry to the file
        foreach (var gazeObject in LoggingList)
        {
            currentEntry = string.Concat(gazeObject.NarrativeBeats + sep + gazeObject.StoryChoice + sep + gazeObject.Timestamp);

            // Write line to file
            using StreamWriter writer = File.AppendText(fileLocation);
            writer.WriteLine(currentEntry);
        }
    }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     _gazeAwareObject = gameObject.GetComponent <GazeAwareObject>();
 }
Exemplo n.º 3
0
 // Start is called before the first frame update
 void Awake()
 {
     _gazeAwareObject = gameObject.GetComponent <GazeAwareObject>();
 }