QuestionData.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class QuestionData
  5. {
  6. public List<QuestionInfor> QuestionList = new List<QuestionInfor>();
  7. public int Score = 0;
  8. public void Init()
  9. {
  10. QuestionInfor question1 = new QuestionInfor();
  11. question1.position = new Vector3(3.301f, 0f, -5.286f);
  12. question1.rotation = new Vector3(0, -116.1f, 0f);
  13. question1.scale = new Vector3(1, 1, 1);
  14. question1.question = "太阳系中最小的行星是?";
  15. question1.Answer.Add("水星");
  16. question1.Answer.Add("木星");
  17. question1.RightAnswer = 0;
  18. question1.score = 10;
  19. QuestionList.Add(question1);
  20. QuestionInfor question2 = new QuestionInfor();
  21. question2.position = new Vector3(3.057f, -0f, -4.788f);
  22. question2.rotation = new Vector3(0, -116.1f, 0f);
  23. question2.scale = new Vector3(1, 1, 1);
  24. question2.question = "金星上的一天等于地球的多少天?";
  25. question2.Answer.Add("245");
  26. question2.Answer.Add("243");
  27. question2.RightAnswer = 1;
  28. question2.score = 10;
  29. QuestionList.Add(question2);
  30. QuestionInfor question3 = new QuestionInfor();
  31. question3.position = new Vector3(2.816f, -0f, -4.296f);
  32. question3.rotation = new Vector3(0, -116.1f, 0f);
  33. question3.scale = new Vector3(1, 1, 1);
  34. question3.question = "太阳系密度最大的天体是?";
  35. question3.Answer.Add("地球");
  36. question3.Answer.Add("火星");
  37. question3.RightAnswer = 0;
  38. question3.score = 10;
  39. QuestionList.Add(question3);
  40. }
  41. }
  42. public class QuestionInfor
  43. {
  44. public Vector3 position = Vector3.zero;
  45. public Vector3 rotation = Vector3.zero;
  46. public Vector3 scale = Vector3.zero;
  47. public string question = null;
  48. public List<string> Answer = new List<string>();
  49. public int RightAnswer = 0;
  50. public int score = 0;
  51. }
  52. public class SendQuestionInfor
  53. {
  54. public string sn = "";
  55. public string cmd = "answer";
  56. public int correct = 0;
  57. public int incorrect = 0;
  58. }