Beispiel #1
0
        public void ShowMenu()
        {
            CFriendMentorTaskView.EMentorTaskState mentorTaskState = Singleton <CTaskSys> .get_instance().MentorTaskState;

            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.MentorTaskFormPath);

            if (form == null)
            {
                return;
            }
            GameObject gameObject  = form.transform.FindChild("content/title").gameObject;
            GameObject gameObject2 = form.transform.FindChild("content/top").gameObject;
            GameObject gameObject3 = form.transform.FindChild("content/middle").gameObject;
            GameObject gameObject4 = form.transform.FindChild("content/bottom").gameObject;
            GameObject gameObject5 = form.transform.FindChild("content/info").gameObject;

            if (mentorTaskState == CFriendMentorTaskView.EMentorTaskState.Empty)
            {
                gameObject.CustomSetActive(false);
                gameObject2.CustomSetActive(false);
                gameObject3.CustomSetActive(false);
                gameObject4.CustomSetActive(false);
                gameObject5.CustomSetActive(true);
                gameObject5.transform.FindChild("txt").GetComponent <Text>().text = Singleton <CTextManager> .get_instance().GetText("MTV_Empty");
            }
            else if (mentorTaskState == CFriendMentorTaskView.EMentorTaskState.Tudi_Task)
            {
                gameObject.CustomSetActive(true);
                gameObject2.CustomSetActive(true);
                gameObject3.CustomSetActive(true);
                gameObject4.CustomSetActive(true);
                gameObject5.CustomSetActive(false);
                this.showTask(Singleton <CTaskSys> .get_instance().apprenticeTaskID);
            }
            else if (mentorTaskState == CFriendMentorTaskView.EMentorTaskState.TudiTaskFinish_No_MasterTask)
            {
                gameObject.CustomSetActive(false);
                gameObject2.CustomSetActive(false);
                gameObject3.CustomSetActive(false);
                gameObject4.CustomSetActive(false);
                gameObject5.CustomSetActive(true);
                gameObject5.transform.FindChild("txt").GetComponent <Text>().text = Singleton <CTextManager> .get_instance().GetText("MTV_MiddleEmpty");
            }
            else if (mentorTaskState == CFriendMentorTaskView.EMentorTaskState.MasterTask)
            {
                gameObject.CustomSetActive(true);
                gameObject2.CustomSetActive(true);
                gameObject3.CustomSetActive(true);
                gameObject4.CustomSetActive(true);
                gameObject5.CustomSetActive(false);
                this.showTask(Singleton <CTaskSys> .get_instance().masterTaskID);
            }
            else if (mentorTaskState == CFriendMentorTaskView.EMentorTaskState.AllFinish)
            {
                gameObject.CustomSetActive(false);
                gameObject2.CustomSetActive(false);
                gameObject3.CustomSetActive(false);
                gameObject4.CustomSetActive(false);
                gameObject5.CustomSetActive(true);
                gameObject5.transform.FindChild("txt").GetComponent <Text>().text = Singleton <CTextManager> .get_instance().GetText("MTV_AllFinish");
            }
        }
Beispiel #2
0
        public void ShowMenu()
        {
            CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.MentorTaskFormPath);

            if (cUIFormScript == null)
            {
                cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CFriendContoller.MentorTaskFormPath, false, true);

                if (cUIFormScript == null)
                {
                    return;
                }
            }
            CFriendMentorTaskView.EMentorTaskState mentorTaskState = Singleton <CTaskSys> .instance.MentorTaskState;
            GameObject gameObject  = cUIFormScript.transform.FindChild("content/title").gameObject;
            GameObject gameObject2 = cUIFormScript.transform.FindChild("content/top").gameObject;
            GameObject gameObject3 = cUIFormScript.transform.FindChild("content/middle").gameObject;
            GameObject gameObject4 = cUIFormScript.transform.FindChild("content/bottom").gameObject;
            GameObject gameObject5 = cUIFormScript.transform.FindChild("content/info").gameObject;

            if (mentorTaskState == CFriendMentorTaskView.EMentorTaskState.Empty)
            {
                gameObject.CustomSetActive(false);
                gameObject2.CustomSetActive(false);
                gameObject3.CustomSetActive(false);
                gameObject4.CustomSetActive(false);
                gameObject5.CustomSetActive(true);
                gameObject5.transform.FindChild("txt").GetComponent <Text>().set_text(Singleton <CTextManager> .instance.GetText("MTV_Empty"));
            }
            else if (mentorTaskState == CFriendMentorTaskView.EMentorTaskState.Tudi_Task)
            {
                gameObject.CustomSetActive(true);
                gameObject2.CustomSetActive(true);
                gameObject3.CustomSetActive(true);
                gameObject4.CustomSetActive(true);
                gameObject5.CustomSetActive(false);
                this.showTask(Singleton <CTaskSys> .instance.apprenticeTaskID);
            }
            else if (mentorTaskState == CFriendMentorTaskView.EMentorTaskState.TudiTaskFinish_No_MasterTask)
            {
                gameObject.CustomSetActive(false);
                gameObject2.CustomSetActive(false);
                gameObject3.CustomSetActive(false);
                gameObject4.CustomSetActive(false);
                gameObject5.CustomSetActive(true);
                gameObject5.transform.FindChild("txt").GetComponent <Text>().set_text(Singleton <CTextManager> .instance.GetText("MTV_MiddleEmpty"));
            }
            else if (mentorTaskState == CFriendMentorTaskView.EMentorTaskState.MasterTask)
            {
                gameObject.CustomSetActive(true);
                gameObject2.CustomSetActive(true);
                gameObject3.CustomSetActive(true);
                gameObject4.CustomSetActive(true);
                gameObject5.CustomSetActive(false);
                this.showTask(Singleton <CTaskSys> .instance.masterTaskID);
            }
            else if (mentorTaskState == CFriendMentorTaskView.EMentorTaskState.AllFinish)
            {
                gameObject.CustomSetActive(false);
                gameObject2.CustomSetActive(false);
                gameObject3.CustomSetActive(false);
                gameObject4.CustomSetActive(false);
                gameObject5.CustomSetActive(true);
                gameObject5.transform.FindChild("txt").GetComponent <Text>().set_text(Singleton <CTextManager> .instance.GetText("MTV_AllFinish"));
            }
            if (!string.IsNullOrEmpty(Singleton <CTaskSys> .instance.errorStr))
            {
                gameObject2.CustomSetActive(true);
                gameObject5.CustomSetActive(false);
                cUIFormScript.GetWidget(2).GetComponent <Text>().set_text(Singleton <CTaskSys> .instance.errorStr);
            }
        }