コード例 #1
0
 /// <summary>
 /// 数据展示转数据
 /// </summary>
 /// <param name="problemDisplay"></param>
 /// <returns></returns>
 public Problem ProblemDisplayToProblem(ProblemDisplay problemDisplay)
 {
     return(new Problem
     {
         id = problemDisplay.id,
         answer = problemDisplay.answer,
         chapter = problemDisplay.chapter,
         mark = problemDisplay.mark,
         done = problemDisplay.done,
         img0 = problemDisplay.ImgMemoryStream0.ToArray(),
         img1 = problemDisplay.ImgMemoryStream1.ToArray(),
         img2 = problemDisplay.ImgMemoryStream2.ToArray(),
         img3 = problemDisplay.ImgMemoryStream3.ToArray(),
         img4 = problemDisplay.ImgMemoryStream4.ToArray(),
         imgans = problemDisplay.ImgMemoryStreamAns.ToArray()
     });
 }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     //getting reference to scripts
     happyManager   = GameObject.Find("HappinessManager");
     penguHappy     = happyManager.GetComponent <PenguinHappiness>();
     panHappy       = happyManager.GetComponent <PandaHappiness>();
     gorHappy       = happyManager.GetComponent <GorillaHappiness>();
     zebHappy       = happyManager.GetComponent <ZebrasHappiness>();
     kangHappy      = happyManager.GetComponent <KangarooHappiness>();
     problemDisplay = this.GetComponent <ProblemDisplay>();
     //hiding objectives initially
     HideAllObjectives();
     //counting the number of problems in the list
     numberofProblemsInList = ProblemsList.Count + 1;
     //do the things that set up the generator
     SetUpGenerator();
 }