private void OnItemRenderer(int index, GObject obj) { var id = m_UI.m_List.GetData <int>(index); var deploy = WantSellDeploy.GetInfo(id); var item = obj as UI_WantBuyItem; item.m_LabelName.SetText(deploy.Name); item.m_LabelDesc.SetText(deploy.Desc); item.m_LoaderIcon.icon = UIUtil.GetBuyPlaceUrl(id); item.m_BtnSell.onClick.Set(OnClickBuy); item.m_BtnSell.data = id; }
private void OnClickBuy(EventContext context) { var id = (int)(context.sender as GObject).data; var deploy = WantSellDeploy.GetInfo(id); var itemData = new ItemData(); itemData.Name = Data.Name; itemData.Value = deploy.Value; itemData.Id = Data.Id; itemData.Type = Data.Type; itemData.Count = 1; ShopFacade.getInstance().SellGoods(itemData); Hide(); }
public override void OnRefresh() { var icon = m_UI.m_Icon as UI_GoodsSmallIcon; icon.m_State.selectedIndex = 1; m_UI.m_Icon.icon = UIUtil.GetGoodsUrl(Data.Type, Data.Id); var info = UniqueSkillProxy.instance.GetData(Data.Id); m_UI.m_LabelName.SetText(Data.Name); m_UI.m_LabelBasePower.SetText(info.Value); m_UI.m_LabelQuality.SetText(Language.GetQuality(info.Quality)); m_UI.m_List.SetData(WantSellDeploy.GetIds()); m_UI.m_ViewState.selectedIndex = Type; AudioManager.inst.PlayAudioEffect("CreateSuccess"); }