public void initData(NoticeWindow faWin, Notice notice) { this.faWin = faWin; this.notice = notice as QuizNotice; noticeSample = notice.getSample(); buttonAnswer.fatherWindow = faWin; buttonGetAward.fatherWindow = faWin; for (int i = 0; i < buttonAnswerKey.Length; i++) { buttonAnswerKey [i].fatherWindow = faWin; } //获取题库 instance.getQuestions(() => { this.examSample = QuizManagerment.Instance.getExamSampleBySid(notice); if (examSample != null && examSample.getAwardType == 1 && examSample.getQuestionSid() == -1) { initAwardUI(); } else { initNormalUI(); } }); }
/** 显示规则 */ void initNormalUI() { NormalGroup.SetActive(true); AnswerGroup.SetActive(false); AwardGroup.SetActive(false); normalTitle.text = noticeSample.name; if (noticeSample.type == NoticeType.QUIZ_EXAM) { normalRule.text = LanguageConfigManager.Instance.getLanguage("quizRule01").Replace("~", "\n"); } else { normalRule.text = LanguageConfigManager.Instance.getLanguage("quizRule02").Replace("~", "\n"); } if (examSample != null) { if (examSample.getAwardType == 2 || examSample.getQuestionSid() == -1) { buttonAnswer.disableButton(true); if (examSample.getAwardType == 2 || examSample.getQuestionSid() == -1) { buttonAnswer.textLabel.text = LanguageConfigManager.Instance.getLanguage("quiz10"); } } else { buttonAnswer.textLabel.text = LanguageConfigManager.Instance.getLanguage("quiz01"); } } else { buttonAnswer.disableButton(true); buttonAnswer.textLabel.text = LanguageConfigManager.Instance.getLanguage("quiz01"); } normalDate.text = notice.getOpenTimeDesc(); normalStatus.text = notice.getTimeDesc(); }