private void Refresh() { if (Object.op_Equality((Object)this.ItemTemplate, (Object)null)) { return; } LimitedShopData limitedShopData = MonoSingleton <GameManager> .Instance.Player.GetLimitedShopData(); DebugUtility.Assert(limitedShopData != null, "Shop information doesn't exist."); this.ShopName.set_text(LocalizedText.Get(GlobalVars.LimitedShopItem.shops.info.title)); for (int index = 0; index < this.mBuyItems.Count; ++index) { this.mBuyItems[index].get_gameObject().SetActive(false); } int count = limitedShopData.items.Count; for (int index = 0; index < count; ++index) { LimitedShopItem data1 = limitedShopData.items[index]; if (index >= this.mBuyItems.Count) { GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate); gameObject.get_transform().SetParent((Transform)this.ItemLayoutParent, false); this.mBuyItems.Add(gameObject); } GameObject mBuyItem = this.mBuyItems[index]; LimitedShopBuyList componentInChildren = (LimitedShopBuyList)mBuyItem.GetComponentInChildren <LimitedShopBuyList>(); componentInChildren.limitedShopItem = data1; componentInChildren.amount.SetActive(!data1.IsSet); DataSource.Bind <LimitedShopItem>(mBuyItem, data1); ItemData data2 = new ItemData(); data2.Setup(0L, data1.iname, data1.num); DataSource.Bind <ItemData>(mBuyItem, data2); DataSource.Bind <ItemParam>(mBuyItem, MonoSingleton <GameManager> .Instance.GetItemParam(data1.iname)); ListItemEvents component1 = (ListItemEvents)mBuyItem.GetComponent <ListItemEvents>(); if (Object.op_Inequality((Object)component1, (Object)null)) { component1.OnSelect = new ListItemEvents.ListItemEvent(this.OnSelect); } Button component2 = (Button)mBuyItem.GetComponent <Button>(); if (Object.op_Inequality((Object)component2, (Object)null)) { ((Selectable)component2).set_interactable(!data1.is_soldout); } mBuyItem.SetActive(true); } GameParameter.UpdateAll(((Component)this).get_gameObject()); }
private void OnSelect(GameObject go) { LimitedShopBuyList component = (LimitedShopBuyList)this.mBuyItems[this.mBuyItems.FindIndex((Predicate <GameObject>)(p => UnityEngine.Object.op_Equality((UnityEngine.Object)p, (UnityEngine.Object)go)))].GetComponent <LimitedShopBuyList>(); GlobalVars.ShopBuyIndex = component.limitedShopItem.id; if (component.limitedShopItem.IsArtifact) { FlowNode_GameObject.ActivateOutputLinks((Component)this, 103); } else if (!component.limitedShopItem.IsSet) { FlowNode_GameObject.ActivateOutputLinks((Component)this, 100); } else { FlowNode_GameObject.ActivateOutputLinks((Component)this, 101); } }
private void Refresh() { if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null)) { return; } LimitedShopData limitedShopData = MonoSingleton <GameManager> .Instance.Player.GetLimitedShopData(); DebugUtility.Assert(limitedShopData != null, "ショップ情報が存在しない"); this.ShopName.set_text(GlobalVars.LimitedShopItem.shops.info.title); if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Updated, (UnityEngine.Object)null)) { this.Updated.SetActive(GlobalVars.LimitedShopItem.btn_update); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Update, (UnityEngine.Object)null)) { this.Update.SetActive(GlobalVars.LimitedShopItem.btn_update); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Lineup, (UnityEngine.Object)null)) { this.Lineup.SetActive(GlobalVars.LimitedShopItem.btn_update); } for (int index = 0; index < this.mBuyItems.Count; ++index) { this.mBuyItems[index].get_gameObject().SetActive(false); } int count = limitedShopData.items.Count; DateTime serverTime = TimeManager.ServerTime; List <LimitedShopItem> nearbyTimeout = new List <LimitedShopItem>(); for (int index = 0; index < count; ++index) { LimitedShopItem data1 = limitedShopData.items[index]; if (data1.end != 0L) { DateTime dateTime = TimeManager.FromUnixTime(data1.end); if (!(serverTime >= dateTime)) { if ((dateTime - serverTime).TotalHours < 1.0) { nearbyTimeout.Add(data1); } } else { continue; } } if (index >= this.mBuyItems.Count) { GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ItemTemplate); gameObject.get_transform().SetParent((Transform)this.ItemLayoutParent, false); this.mBuyItems.Add(gameObject); } GameObject mBuyItem = this.mBuyItems[index]; LimitedShopBuyList componentInChildren = (LimitedShopBuyList)mBuyItem.GetComponentInChildren <LimitedShopBuyList>(); componentInChildren.limitedShopItem = data1; DataSource.Bind <LimitedShopItem>(mBuyItem, data1); componentInChildren.amount.SetActive(!data1.IsSet); if (data1.IsArtifact) { ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(data1.iname); DataSource.Bind <ArtifactParam>(mBuyItem, artifactParam); } else if (data1.IsConceptCard) { ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(data1.iname); componentInChildren.SetupConceptCard(cardDataForDisplay); } else if (data1.IsItem || data1.IsSet) { ItemData data2 = new ItemData(); data2.Setup(0L, data1.iname, data1.num); DataSource.Bind <ItemData>(mBuyItem, data2); DataSource.Bind <ItemParam>(mBuyItem, MonoSingleton <GameManager> .Instance.GetItemParam(data1.iname)); } else { DebugUtility.LogError(string.Format("不明な商品タイプが設定されています (shopitem.iname({0}) => {1})", (object)data1.iname, (object)data1.ShopItemType)); } ListItemEvents component1 = (ListItemEvents)mBuyItem.GetComponent <ListItemEvents>(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component1, (UnityEngine.Object)null)) { component1.OnSelect = new ListItemEvents.ListItemEvent(this.OnSelect); } Button component2 = (Button)mBuyItem.GetComponent <Button>(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component2, (UnityEngine.Object)null)) { ((Selectable)component2).set_interactable(!data1.is_soldout); } mBuyItem.SetActive(true); } this.ShowAndSaveTimeOutItem(nearbyTimeout); GameParameter.UpdateAll(((Component)this).get_gameObject()); }