private void OnSelect(GameObject go) { GlobalVars.ShopBuyIndex = this.mBuyItems.FindIndex((Predicate <GameObject>)(p => UnityEngine.Object.op_Equality((UnityEngine.Object)p, (UnityEngine.Object)go))); EventShopBuyList component = (EventShopBuyList)this.mBuyItems[GlobalVars.ShopBuyIndex].GetComponent <EventShopBuyList>(); if (component.eventShopItem.IsArtifact) { FlowNode_GameObject.ActivateOutputLinks((Component)this, 103); } else if (!component.eventShopItem.IsSet) { FlowNode_GameObject.ActivateOutputLinks((Component)this, 100); } else { FlowNode_GameObject.ActivateOutputLinks((Component)this, 101); } }
private void Refresh() { MonoSingleton <GameManager> .Instance.Player.UpdateEventCoin(); if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null)) { return; } this.SetPossessionCoinParam(); EventShopData eventShopData = MonoSingleton <GameManager> .Instance.Player.GetEventShopData(); DebugUtility.Assert(eventShopData != null, "ショップ情報が存在しない"); for (int index = 0; index < this.mBuyItems.Count; ++index) { this.mBuyItems[index].get_gameObject().SetActive(false); } int count = eventShopData.items.Count; DateTime serverTime = TimeManager.ServerTime; List <EventShopItem> nearbyTimeout = new List <EventShopItem>(); for (int index = 0; index < count; ++index) { EventShopItem data1 = eventShopData.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]; EventShopBuyList componentInChildren = (EventShopBuyList)mBuyItem.GetComponentInChildren <EventShopBuyList>(); componentInChildren.eventShopItem = data1; DataSource.Bind <EventShopItem>(mBuyItem, data1); 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()); }