private EyeTrackingData getEyeTracker() { if (this.dataWriter == null) { var eyeTrackingData = GameObject.Find("DistractionController"); if (eyeTrackingData != null) { this.dataWriter = eyeTrackingData.GetComponent(typeof(EyeTrackingData)) as EyeTrackingData; } } return(dataWriter); }
void Awake() { if (instance != null) { Destroy(this.gameObject); } else { instance = this; outputFile = CSVWriter.NewOutputFile(FindObjectOfType <SubjectDataHolder>(), filename); messageQueue.Enqueue(RowData.HEADER); var fileWriteCallback = new TimerCallback(delegate(object state) { WriteDataToFile(); }); var fileWriteInterval = new TimeSpan(0, 0, 10); // Every 10 seconds this.fileWriteTimer = new Timer(fileWriteCallback, null, NO_DELAY, fileWriteInterval); print("Started file writer. Schedule: every " + fileWriteInterval.ToString()); } }
// This function parses the external module's full-data data into multiple VRCFT-Parseable single-eye structs public static void Update(ref EyeTrackingData data, ExampleExternalTrackingDataStruct external) { Update(ref data.Right, external.left_eye); Update(ref data.Left, external.right_eye); }