public void setData(PropData pd, UIBagPropInfo bagInfo, bool isFirst) { m_propData = pd; m_bagInfo = bagInfo; if (pd == null || bagInfo == null) { return; } m_Icon_img.Sprite = pd.prop.icon; m_Num_lab.Text = pd.num.ToString(); this.m_isFirst = isFirst; if (isFirst) { if (m_item_btn.Checked) { btnClick(true); } else { m_item_btn.Checked = true; } } m_lastPropData = m_propData; }
void initControl() { #region 控件 int pageCount = m_btnPage_Str.Length; m_page_toggle = new GameToggleButton[pageCount]; //m_page_tween = new TweenScale[pageCount]; m_arrow_obj = new GameObject[pageCount]; this.m_arrowLab_obj = new GameLabel[pageCount]; this.m_oriLab_obj = new GameObject[pageCount]; //this.m_arrowLab_obj = new GameObject[pageCount]; m_pageTog_lab = new GameLabel[pageCount]; for (int i = 0; i < m_btnPage_Str.Length; i++) { m_page_toggle[i] = Make <GameToggleButton>(string.Format("Panel_down:leftBtn:{0}", m_btnPage_Str[i])); //m_page_tween[i] = m_page_toggle[i].gameObject.GetComponent<TweenScale>(); m_arrow_obj[i] = m_page_toggle[i].Widget.Find("Background/Checkmark/Arrow").gameObject; m_arrowLab_obj[i] = m_page_toggle[i].Make <GameLabel>("Background/Checkmark/Label (1)"); this.m_oriLab_obj[i] = m_page_toggle[i].Widget.Find("Background/Label").gameObject; m_pageTog_lab[i] = m_page_toggle[i].Make <GameLabel>("Label"); m_pageTog_lab[i].color = m_oriColor; m_arrowLab_obj[i].Text = m_pageTog_lab[i].Text = m_toogle_name_Str[i]; m_arrow_obj[i].SetActive(false); m_arrowLab_obj[i].SetActive(false); this.m_oriLab_obj[i].SetActive(true); } m_Prop_grid = Make <GameUIContainer>("Panel_down:Panel:grid"); m_NothingTip_lab = Make <GameLabel>("Panel_down:nothingTips"); m_propInfo_panel = Make <UIBagPropInfo>("Panel_down:detail"); m_chooseUIEffect = Make <GameUIEffect>("Panel_down:UI_xuanzhong"); m_panelDown_Img = Make <GameImage>("Panel_down"); //this.m_tweenPos = this.m_panelDown_Img.GetComponent<TweenScale>(); #endregion }