示例#1
0
        void ShowHint()
        {
            string[] hintTexts = ReadTestController.GetController().GetHints();
            string   oldString = readingText.text;
            string   newString = "";


            for (int i = 0; i < hintTexts.Length; i++)
            {
                int hintIndex  = readingText.text.IndexOf(hintTexts[i]);
                int hintLength = hintTexts[i].Length;

                string start  = oldString.Substring(0, hintIndex);
                string middle = oldString.Substring(hintIndex, hintLength);
                string end    = oldString.Substring(hintIndex + hintLength, oldString.Length - (hintIndex + hintLength));

                newString = start + "<color=white>" + middle + "</color>" + end;

                oldString = newString;
            }

            readingText.text = newString;

            ReadTestController.GetController().LogHint();
        }
示例#2
0
        public void OnClickSubmit()
        {
            IEnumerator <Toggle> toggleEnum = toggleGroup.ActiveToggles().GetEnumerator();

            toggleEnum.MoveNext();
            Toggle toggle = toggleEnum.Current;

            toggle.isOn = false;
            PlaySoundClick();
            ReadTestController.GetController().CheckAnswer(toggle.GetComponentInChildren <Text>().text);
        }
示例#3
0
 void Awake()
 {
     if (readTestController == null)
     {
         readTestController = this;
     }
     else if (readTestController != this)
     {
         Destroy(this);
     }
     InitGame();
 }
示例#4
0
 public override void NextChallenge()
 {
     questionCounter++;
     if (questionCounter < questions.Count)
     {
         currentQuestion = questions [questionCounter];
         currentAnswer   = currentQuestion.AnswersTexts [0];
         Shuffle(currentQuestion.AnswersTexts);
     }
     else
     {
         ReadTestController.GetController().EndGame();
         MetricsController.GetController().GameEnd();
     }
 }