protected override void InitWidget() { this.SKillView = this.mRoot.Find("SkillView").gameObject; this.SkillLearn = this.mRoot.Find("SkillLearn").gameObject; this.MySelf = this.mRoot.Find("MySelf").gameObject; this.ButtonSpeak = this.mRoot.Find("bt_voice").gameObject; GuideController.singleton.AddGuideEventButton(this.ButtonSpeak); this.SpeakMask = this.mRoot.Find("sp_black").gameObject; this.entity = new EntityLearn(); this.entity.Init(this.MySelf.transform); this.SpeakToken = this.mRoot.Find("sp_token").gameObject; this.m_Iamge_SkillIcon = this.mRoot.Find("SkillLearn/SkillIcon").GetComponent <Image>(); this.m_Text_SkillInfo = this.mRoot.Find("SkillLearn/SkillInfo/lb_info").GetComponent <Text>(); this.m_Text_SkillName = this.mRoot.Find("SkillLearn/SkillName/Text").GetComponent <Text>(); this.m_Text_Token = this.mRoot.Find("sp_token/lb_info").GetComponent <Text>(); this.m_Button_Close = this.mRoot.Find("SkillView/bt_close").GetComponent <Button>(); this.m_Button_Close.onClick.AddListener(this.OnClickButtonClose); GuideController.singleton.AddGuideEventButton(this.m_Button_Close.gameObject); this.m_List_Skills = this.mRoot.Find("SkillView/Viewport/Content").GetComponent <XUIList>(); this.m_List_Skills.RegisterListSelectEventHandler(this.OnSelectSkillItem); this.m_Button_Test = this.mRoot.Find("SkillLearn/bt_speakTest").GetComponent <Button>(); this.m_Button_Test.onClick.AddListener(this.OnClickButtonSpeakTest); GuideController.singleton.AddGuideEventButton(this.m_Button_Test.gameObject); this.m_Button_Learn = this.mRoot.Find("SkillLearn/bt_learn").GetComponent <Button>(); this.m_Button_Learn.onClick.AddListener(this.OnClickButtonSelfSpeak); GuideController.singleton.AddGuideEventButton(this.m_Button_Learn.gameObject); this.m_Button_Back = this.mRoot.Find("bt_back").GetComponent <Button>(); this.m_Button_Back.onClick.AddListener(this.OnClickButtonBack); GuideController.singleton.AddGuideEventButton(this.m_Button_Back.gameObject); }
public override void OnDisable() { this.entity = null; VoiceManager.Instance.UnRegisterCallback(); }