public void SetData(ConfTitle confTitle, TitleMsg title, bool isChoose, bool isLock) { if (confTitle == null) { Visible = false; return; } this.m_detailLab.Text = LocalizeModule.Instance.GetString(confTitle.info); m_curTitle = title; if (confTitle != null) { m_Name_lab.Text = LocalizeModule.Instance.GetString(confTitle.name); List <RankData> rankdatas = PlayerTitleHelper.GetRandData(confTitle.benefit); m_addition_lab[0].Visible = false; m_addition_lab[1].Visible = false; for (int i = 0; i < 2; i++) { if (i < rankdatas.Count) { m_addition_lab[i].Text = LocalizeModule.Instance.GetString(string.Format("RankType_{0}", rankdatas[i].type), rankdatas[i].value); m_addition_lab[i].Visible = !isLock; } } m_desc_lab.Text = LocalizeModule.Instance.GetString(confTitle.source); } m_icon_img.Sprite = confTitle.icon; bool active = !isLock; m_mask_img.Visible = !active; m_lock_img.Visible = !active; m_desc_lab.Visible = !active; m_currentState = isChoose; m_choose_btn.Enable = active; m_Expired_lab.Visible = false; m_Name_lab.color = m_oriColor; m_addition_lab[0].color = m_oriColor; m_addition_lab[1].color = m_oriColor; m_TimeLab.Visible = false; if (active) //是否已拥有 { long nowTicks = CommonTools.DateTimeToTimeStamp(System.DateTime.Now) / 10000; if (title.Deadline > 0) { if (title.Deadline < nowTicks) { m_TimeLab.Visible = false; //过期 m_Name_lab.color = m_grayColor; m_addition_lab[0].color = m_grayColor; //m_additionNum01_lab.color = m_grayColor; m_addition_lab[1].color = m_grayColor; //m_additionNum02_lab.color = m_grayColor; m_bg_img.SetGray(true); m_icon_img.SetGray(true); m_Expired_lab.Visible = true; m_choose_btn.Enable = false; } else { DateTime deadTime = CommonTools.TimeStampToDateTime(title.Deadline * 10000); if (deadTime != null) { m_TimeLab.Text = CommonTools.SecondToTitleString((deadTime - DateTime.Now).TotalSeconds); } m_TimeLab.Visible = true; } } } m_require_img.Visible = m_currentState; }