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(); }
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); }
void Awake() { if (readTestController == null) { readTestController = this; } else if (readTestController != this) { Destroy(this); } InitGame(); }
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(); } }