public bool endChild() { currentTask.endTask(); currentTaskIndex++; // If we've finished all the tasks in all the cycles (repeats), end this tasklist if (currentTaskIndex >= tasks.Length && repeatCount >= repeat) { currentTaskIndex = 0; repeatCount = 1; return(true); } else { // If we've reached the last task but have cycles (repeats) left -- reset task index, increment repeatcount and run startNextTask() if (currentTaskIndex >= tasks.Length) { repeatCount++; // increment the repeat count (i.e., update block/trial/repeat number) currentTaskIndex = 0; // reset the task index so the next task that starts is the first in the list } // Start the next task in the list startNextTask(); } return(false); }
public bool endChild() { currentTask.endTask(); currentTaskIndex = currentTaskIndex + 1; if (currentTaskIndex >= tasks.Length && repeatCount >= repeat) { currentTaskIndex = 0; repeatCount = 1; return(true); } else { if (currentTaskIndex >= tasks.Length) { repeatCount++; currentTaskIndex = 0; } startNextTask(); } return(false); }