Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public TextAsset QuestionsXml;
- void Awake()
- {
- if (QuestionsXml != null)
- {
- XmlTextReader reader = new XmlTextReader(new StringReader(QuestionsXml.text));
- while (reader.Read())
- {
- if (reader.Name == "Question")
- {
- Debug.Log(reader.Name + " " + reader.GetAttribute("QuestionText"));
- Debug.Log(reader.Name + " " + reader.GetAttribute("Answer1"));
- Debug.Log(reader.Name + " " + reader.GetAttribute("Answer2"));
- Debug.Log(reader.Name + " " + reader.GetAttribute("Answer3"));
- Debug.Log(reader.Name + " " + reader.GetAttribute("Answer4"));
- Debug.Log(reader.Name + " " + reader.GetAttribute("CorrectAnswer"));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment