private GameObject CreateListItem(EventCoinData eventcoin_data) { GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ItemTemplate); EventCoinListItem component1 = (EventCoinListItem)gameObject.GetComponent <EventCoinListItem>(); Button component2 = (Button)component1.Button.GetComponent <Button>(); ListItemEvents component3 = (ListItemEvents)component1.Button.GetComponent <ListItemEvents>(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component2, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object)component3, (UnityEngine.Object)null)) { EventShopListItem eventShopListItem = GlobalVars.EventShopListItems.Find((Predicate <EventShopListItem>)(f => f.shop_cost_iname.Equals(eventcoin_data.iname))); bool flag = false; if (UnityEngine.Object.op_Inequality((UnityEngine.Object)eventShopListItem, (UnityEngine.Object)null) && eventShopListItem.shops != null && eventShopListItem.shops.unlock != null && (eventShopListItem.shops.unlock.flg != 1 ? 0 : 1) != 0) { flag = true; } if (flag) { component3.OnSelect = new ListItemEvents.ListItemEvent(this.OnSelect); ((Selectable)component2).set_interactable(true); } else { ((Selectable)component2).set_interactable(false); } } return(gameObject); }
private GameObject CreateOtherListItem(GameObject template, ListItemEvents.ListItemEvent func, bool is_button_enable) { GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)template); EventCoinListItem component1 = (EventCoinListItem)gameObject.GetComponent <EventCoinListItem>(); Button component2 = (Button)component1.Button.GetComponent <Button>(); ListItemEvents component3 = (ListItemEvents)component1.Button.GetComponent <ListItemEvents>(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component3, (UnityEngine.Object)null) && is_button_enable) { component3.OnSelect = func; ((Selectable)component2).set_interactable(true); } else { ((Selectable)component2).set_interactable(false); } return(gameObject); }