protected void PrepareQuestion(QuestionData.question q) { HideAllChoices(); activeQuestion = q; question.text = q.content; additionalInfo.text = ""; //foreach (QuestionData.answer answer in q.answers) for (int i = 0; i < q.answers.Count; i++) { QuestionData.answer answer = q.answers[i]; if (i < choices.Length) { UIButton choice = choices[i]; ChangeButtonColor(choice, Color.white); UILabel label = choice.transform.FindChild("Label").GetComponent <UILabel>(); if (label != null) { label.text = answer.text; } choice.gameObject.SetActive(true); } } _enableTimer = true; }
private void StartElement(ref QuestionData qData, XmlReader xml) { switch (xml.Name) { case "question": q = new QuestionData.question(); break; case "answers": break; case "answer": answer = new QuestionData.answer(); answer.option = xml.GetAttribute(0); break; } }