Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        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;
            }
        }