/// <summary>
 /// Register when a task is successfully completed.
 /// </summary>
 /// <param name="task">The task which was completed.</param>
 public static void CompleteTask(AutograderTask task)
 {
     if (AutograderManager.CurTask == task)
     {
         task.Disable();
         AutograderManager.instance.levelScore += task.Points;
         AutograderManager.instance.hud.UpdateScore(AutograderManager.instance.levelScore, AutograderManager.LevelInfo.MaxPoints);
         AutograderManager.instance.taskIndex++;
         if (AutograderManager.instance.taskIndex >= AutograderManager.instance.tasks.Length)
         {
             if (!AutograderManager.LevelInfo.DoNotProceedUntilStopped)
             {
                 AutograderManager.instance.FinishLevel();
             }
         }
         else
         {
             AutograderManager.CurTask.Enable();
         }
     }
     else
     {
         Debug.LogError($"[AutograderManager::CompleteTask]: CompleteTask was called for task [{task}], but this is not the active task. No action taken.");
     }
 }
示例#2
0
 private void Awake()
 {
     this.autograderTask = this.GetComponent <AutograderTask>();
 }