// 图标被点中展示物品信息 void ChildItemIconClick(SysShopPageItem curItem) { HighLightItem(curItem); if (null != SysShopController.Instance()) { SysShopController.Instance().ShowCurItemTip(); } }
void OnDisable() { if (null != m_curHighLightItem) { m_curHighLightItem.EnableHighLight(false); m_curHighLightItem = null; } }
public void HighLightItem(SysShopPageItem curItem) { if (m_curHighLightItem != null) { m_curHighLightItem.EnableHighLight(false); } if (null != curItem) { curItem.EnableHighLight(true); } m_curHighLightItem = curItem; }
public void AddItem(GameObject curItem, int index, int shopIndex, Tab_SystemShop tabSysShop) { if (null == curItem) { return; } //curItem.transform.localPosition = new Vector3(xStartPos + widthDiff * (index % 2), yStartPos - heightDiff * (index /2)); SysShopPageItem shopPageItem = curItem.GetComponent <SysShopPageItem>(); if (null != shopPageItem) { shopPageItem.SetData(ChildItemClick, ChildItemDoubleClick, ChildItemIconClick, shopIndex, tabSysShop); } }
// 批量购买确定 void OnNumChoose(int curNum) { if (null == m_curShowPage) { LogModule.ErrorLog("curShowPage can not find"); return; } SysShopPageItem curItem = m_curShowPage.GetComponent <SysShopPage>().GetCurHighLightItem(); if (null == curItem) { LogModule.ErrorLog("cur select item is none"); return; } BuyItem(curItem.gameObject.name, curNum); }
void CloseCurItemTip() { SysShopPageItem curItem = GetSelectedItem(); if (null == curItem) { return; } if (curItem.GetGameItem().IsEquipMent()) { UIManager.CloseUI(UIInfo.EquipTooltipsRoot); } else { UIManager.CloseUI(UIInfo.ItemTooltipsRoot); } }
// 购买当前选中物品 public void BuyCurItem() { CloseCurItemTip(); if (null != m_curShowPage) { SysShopPage curPage = m_curShowPage.GetComponent <SysShopPage>(); if (curPage == null) { return; } SysShopPageItem curItem = curPage.GetCurHighLightItem(); if (curItem == null) { return; } BuyItem(curItem.gameObject.name, 1); } }
// 显示当前物品信息 public void ShowCurItemTip() { SysShopPageItem curItem = GetSelectedItem(); if (null == curItem) { return; } if (curItem.GetGameItem().IsEquipMent()) { EquipTooltipsLogic.SetDelegateBuyClick(EquipBuyBatchClick, EquipBuyClick); // EquipTooltipsLogic.ShowEquipTooltip(curItem.GetGameItem(), // m_curShopTable.CanBuyMulty > 0 ? EquipTooltipsLogic.ShowType.ShopBuyBatch : EquipTooltipsLogic.ShowType.ShopBuy); EquipTooltipsLogic.ShowEquipTooltip(curItem.GetGameItem(), EquipTooltipsLogic.ShowType.Info); } else { ItemTooltipsLogic.SetDelegateBuyClick(ItemBuyBatchClick, ItemBuyClick); // ItemTooltipsLogic.ShowItemTooltip(curItem.GetGameItem(), // m_curShopTable.CanBuyMulty > 0 ? ItemTooltipsLogic.ShowType.ShopBuyBatch : ItemTooltipsLogic.ShowType.ShopBuy,null); ItemTooltipsLogic.ShowItemTooltip(curItem.GetGameItem(), ItemTooltipsLogic.ShowType.Info); } }
// 双击直接购买 void ChildItemDoubleClick(SysShopPageItem curItem) { HighLightItem(curItem); SysShopController.BuyItem(curItem.name, 1); }
// 点中高亮 void ChildItemClick(SysShopPageItem curItem) { HighLightItem(curItem); }