void Update() { // Do not run update if the application is not visible if (!VarjoManager.Instance.IsLayerVisible() || VarjoManager.Instance.IsInStandBy()) { return; } if (Input.GetKeyDown(toggleLoggingKey)) { if (!logging) { StartLogging(); } else { StopLogging(); } return; } if (logging) { if (oneGazeDataPerFrame) { // Get and log latest gaze data LogGazeData(VarjoPlugin.GetGaze()); } else { // Get and log all gaze data since last update dataSinceLastUpdate = VarjoPlugin.GetGazeList(); foreach (var data in dataSinceLastUpdate) { LogGazeData(data); } } } else if (startAutomatically) { if (VarjoPlugin.GetGaze().status == VarjoPlugin.GazeStatus.VALID) { StartLogging(); } } }
void Update() { if (logging) { // Get and log all gaze data since last update dataSinceLastUpdate = VarjoPlugin.GetGazeList(); foreach (var data in dataSinceLastUpdate) { LogGazeData(data); } } else if (startAutomatically) { if (VarjoPlugin.GetGaze().status == VarjoPlugin.GazeStatus.VALID) { StartLogging(); } } }