public void ReportTaskFinished(Task.Task task, float?measurement) { if (task != currentTask) { Debug.LogError($"{task} reported as finished, but that ${currentTask} is currently active"); return; } results.AttachMeasurement(task.name, measurement); Debug.Log($"{currentTask} has finished"); currentTask = null; waitingTime = tasks.HasNext ? settings.PauseBetweenTasks : settings.PauseAfterTasks; }
private void newTask() { currentTask = tasks.CreateNext(nextStimulus); if (currentTask == null) { Debug.Log("All tasks finished!"); IsActive = false; return; } currentTask.StartTask(this, nextStimulus); nextStimulus = StimuliTypeExtensions.Next(); }
private void DetectInterruptedTest() { if (Input.GetKeyDown(KeyCode.Escape)) { Debug.LogWarning("Test aborted by user!"); tasks.End(); if (currentTask != null) { Destroy(currentTask.gameObject); currentTask = null; } IsActive = false; waitingTime = 0.01f; } }