SHARE
TWEET

Untitled

a guest Sep 18th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class EvaluationManager : MonoBehaviour
  6. {
  7.     public ToggleMaster toggleMaster;
  8.  
  9.     public void Evaluate()
  10.     {
  11.         bool passed = (IncorrectAnswers() == 0);
  12.         Debug.Log("You got: " + IncorrectAnswers() + " answers wrong, passed: " + passed);
  13.     }
  14.  
  15.     int IncorrectAnswers()
  16.     {
  17.         int wrongAnswers = 0;
  18.  
  19.         foreach(var toggleParent in toggleMaster.ToggleParents)
  20.         {
  21.             if (toggleParent.isCorrectAnswer()) wrongAnswers++;
  22.         }
  23.  
  24.         return wrongAnswers;
  25.     }
  26.  
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top