Exemple #1
0
        public override void Awake(GameObject go)
        {
            #region
            Instance     = this;
            queText      = transform.Find("QuestionText").GetComponent <Text>();
            shuomingText = transform.Find("Shuoming").gameObject;
            tg           = transform.Find("ToggleGroup").GetComponent <ToggleGroup>();
            toggle.Clear();
            for (int i = 0; i < tg.transform.childCount; i++)
            {
                toggle.Add(tg.transform.GetChild(i).GetComponent <Toggle>());
            }
            #endregion
            this.transform.Find("ResetButton").GetComponent <Button>().onClick.AddListener(delegate
            {
                Clear();
            });

            //if (UIManager.Instance.iskaohe)
            //{
            //    this.transform.Find("SubmitBtn").GetComponent<Button>().onClick.AddListener(delegate
            //    {
            //        PlayerController.Instance.GetComponent<UnityStandardAssets.Characters.FirstPerson.FirstPersonController>().enabled = true;
            //        AudioManager.instance.StopAudio();
            //        ScoreInfo score = Check();
            //        TTUIPage.ClosePage(this.name);
            //        ScoreInfo.AddSocreInfo(score);
            //        Clear();
            //        this.transform.FindChild("Answer").GetComponent<Text>().text = "选项内容:";
            //        UIMgr.Instance.AddStep();
            //    });
            //}
            //else
            //{
            this.transform.Find("SubmitButton").GetComponent <Button>().onClick.AddListener(delegate
            {
                ScoreInfo score = Check();
                if (score.result)
                {
                    FirstPersonController.Instance.GetComponent <FirstPersonController>().enabled = true;
                    score.wrong = index;
                    index       = 0;
                    ScoreInfo.AddSocreInfo(score);
                    Clear();
                    CloseQue();
                }
                else
                {
                    index++;
                    Clear();
                }
            });
            //}
        }