private void ShowJobPlaceInfor() { NGUITools.SetActive(JobPlaceUIScrollView.gameObject, true); NGUITools.SetActive(JobInformation.gameObject, false); HelpUtil.DelListInfo(JobPlaceUIGrid.transform); foreach (KeyValuePair <int, JobPlaceConfig.JobPlaceElement> jobPlaceElement in jobPlaceConfig.GetJobPlaceElementList()) { GameObject jobPlaceItem = GameObject.Instantiate(JobPlaceItem) as GameObject; jobPlaceItem.transform.parent = JobPlaceUIGrid.transform; jobPlaceItem.transform.localScale = Vector3.one; jobPlaceItem.transform.localPosition = Vector3.zero; jobPlaceItem.name = "JobPlaceItem" + jobPlaceElement.Key; UILabel nameLabel = jobPlaceItem.transform.Find("NameLabel").GetComponent <UILabel>(); UILabel noGoIntoLabel = jobPlaceItem.transform.Find("NoGoIntoLabel").GetComponent <UILabel>(); UIButton GoIntoBtn = jobPlaceItem.transform.Find("GoIntoBtn").GetComponent <UIButton>(); nameLabel.text = jobPlaceElement.Value.Job_Place_Name; if (jobPlaceElement.Value.Need_Fans > playerData.starData.nRoleFenSi) { NGUITools.SetActive(noGoIntoLabel.gameObject, true); noGoIntoLabel.text = string.Format(Globals.Instance.MDataTableManager.GetWordText(3001), jobPlaceElement.Value.Need_Fans); // 需要文本ID // NGUITools.SetActive(GoIntoBtn.gameObject, false); } else { NGUITools.SetActive(noGoIntoLabel.gameObject, false); NGUITools.SetActive(GoIntoBtn.gameObject, true); GoIntoBtn.Data = jobPlaceElement.Value; UIEventListener.Get(GoIntoBtn.gameObject).onClick += OnClickGoIntoBtn; } } JobPlaceUIGrid.sorting = UIGrid.Sorting.Custom; JobPlaceUIGrid.repositionNow = true; JobPlaceUIGrid.onReposition += RefreshGuide; }
private void RefreshJobList(PlayerData playerData) { Dictionary <int, List <int> > jobRefreshDic = new Dictionary <int, List <int> >(); JobPlaceConfig jobPlaceConfig = Globals.Instance.MDataTableManager.GetConfig <JobPlaceConfig>(); JobConfig jobConfig = Globals.Instance.MDataTableManager.GetConfig <JobConfig>(); foreach (KeyValuePair <int, JobPlaceConfig.JobPlaceElement> jobPlaceElement in jobPlaceConfig.GetJobPlaceElementList()) { jobRefreshDic.Add(jobPlaceElement.Key, jobConfig.GetJobSingleElementList(jobPlaceElement.Key)); } Globals.Instance.MJobManager.getJobPlaceInformationDic = jobRefreshDic; NetSender.Instance.C2GSModifyJobListReq(jobRefreshDic, playerData.starData.nLineDay); Globals.Instance.MJobManager.GetJobRefreshLastTime = playerData.starData.nLineDay; }