public void SetShopItemInfo(Json_ShopItemDesc shop_item_desc, string name) { this.ItemIcon.SetActive(!shop_item_desc.IsArtifact); this.ArtifactIcon.SetActive(shop_item_desc.IsArtifact); this.Amount.set_text(shop_item_desc.num.ToString()); this.Name.set_text(name); }
public void SetShopItemDesc(Json_ShopItemDesc item) { this.ItemIcon.SetActive(false); this.ArtifactIcon.SetActive(false); this.ConceptCard.SetActive(false); if (item.IsItem) { this.ItemIcon.SetActive(true); } else if (item.IsArtifact) { this.ArtifactIcon.SetActive(true); } else if (item.IsConceptCard) { this.ConceptCard.SetActive(true); } else { DebugUtility.LogError(string.Format("不明な商品タイプが設定されています (item.iname({0}) => {1})", (object)item.iname, (object)item.itype)); } if (this.mShopItem == null) { this.mShopItem = (ShopItem) new LimitedShopItem(); } this.mShopItem.num = item.num; this.mShopItem.iname = item.iname; }
public void SetShopItemDesc(Json_ShopItemDesc item) { this.ItemIcon.SetActive(!item.IsArtifact); this.ArtifactIcon.SetActive(item.IsArtifact); if (this.mShopItem == null) { this.mShopItem = (ShopItem) new LimitedShopItem(); } this.mShopItem.num = item.num; this.mShopItem.iname = item.iname; }
public void SetShopItemInfo(Json_ShopItemDesc shop_item_desc, string name, int amount) { this.ItemIcon.SetActive(false); this.ArtifactIcon.SetActive(false); ((Component) this.m_ConceptCardIcon).get_gameObject().SetActive(false); if (shop_item_desc.IsItem) this.ItemIcon.SetActive(true); else if (shop_item_desc.IsArtifact) this.ArtifactIcon.SetActive(true); else if (shop_item_desc.IsConceptCard) ((Component) this.m_ConceptCardIcon).get_gameObject().SetActive(true); this.Amount.set_text((shop_item_desc.num * amount).ToString()); this.Name.set_text(name); }
private void Refresh() { GameUtility.DestroyGameObjects(this.mItems); this.mItems.Clear(); ShopData shopData = MonoSingleton <GameManager> .Instance.Player.GetShopData(GlobalVars.ShopType); if (shopData == null || shopData.items.Count <= 0 || UnityEngine.Object.op_Equality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null)) { return; } int shopdata_index = GlobalVars.ShopBuyIndex; Transform parent = !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ItemParent, (UnityEngine.Object)null) ? this.ItemTemplate.get_transform().get_parent() : this.ItemParent.get_transform(); ShopItem shopItem = shopData.items.FirstOrDefault <ShopItem>((Func <ShopItem, bool>)(item => item.id == shopdata_index)); List <Json_ShopItemDesc> jsonShopItemDescList = new List <Json_ShopItemDesc>(); if (shopItem.IsArtifact) { jsonShopItemDescList.Add(new Json_ShopItemDesc() { iname = shopItem.iname, itype = ShopData.ShopItemType2String(shopItem.ShopItemType), num = shopItem.num }); } else if (shopItem.children != null && shopItem.children.Length > 0) { jsonShopItemDescList.AddRange((IEnumerable <Json_ShopItemDesc>)shopItem.children); } if (jsonShopItemDescList.Count > 0) { for (int index = 0; index < jsonShopItemDescList.Count; ++index) { Json_ShopItemDesc shop_item_desc = jsonShopItemDescList[index]; string empty = string.Empty; GameObject gameObject; string name; if (shop_item_desc.IsArtifact) { ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(shop_item_desc.iname); if (artifactParam != null) { gameObject = this.InstantiateItem <ArtifactParam>(this.ItemTemplate, parent, artifactParam); name = artifactParam.name; } else { continue; } } else if (shop_item_desc.IsConceptCard) { ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(shop_item_desc.iname); if (cardDataForDisplay != null) { gameObject = this.InstantiateItem <ConceptCardData>(this.ItemTemplate, parent, cardDataForDisplay); ConceptCardIcon componentInChildren = (ConceptCardIcon)gameObject.GetComponentInChildren <ConceptCardIcon>(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)componentInChildren, (UnityEngine.Object)null)) { componentInChildren.Setup(cardDataForDisplay); } name = cardDataForDisplay.Param.name; } else { continue; } } else { ItemData itemData = new ItemData(); if (itemData.Setup(0L, shop_item_desc.iname, shop_item_desc.num)) { gameObject = this.InstantiateItem <ItemData>(this.ItemTemplate, parent, itemData); name = itemData.Param.name; } else { continue; } } ShopGiftItem component = (ShopGiftItem)gameObject.GetComponent <ShopGiftItem>(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null)) { component.SetShopItemInfo(shop_item_desc, name, GlobalVars.ShopBuyAmount); } } } GameParameter.UpdateAll(((Component)parent).get_gameObject()); }