public void UpdateValue() { ItemSelectListItemData dataOfClass = DataSource.FindDataOfClass <ItemSelectListItemData>(((Component)this).get_gameObject(), (ItemSelectListItemData)null); Text component = (Text)((Component)this).get_gameObject().GetComponent <Text>(); if (!Object.op_Inequality((Object)component, (Object)null) || dataOfClass == null) { return; } component.set_text(dataOfClass.num.ToString()); }
public void Refresh(ItemSelectListItemData[] shopdata) { if (Object.op_Equality((Object)this.ItemTemplate, (Object)null)) { return; } PlayerData player = MonoSingleton <GameManager> .Instance.Player; for (int index = 0; index < this.ItemSelectItem.Count; ++index) { this.ItemSelectItem[index].get_gameObject().SetActive(false); } int length = shopdata.Length; for (int index = 0; index < length; ++index) { ItemSelectListItemData data = shopdata[index]; if (index >= this.ItemSelectItem.Count) { GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate); gameObject.get_transform().SetParent((Transform)this.ItemLayoutParent, false); this.ItemSelectItem.Add(gameObject); } GameObject gameObject1 = this.ItemSelectItem[index]; DataSource.Bind <ItemSelectListItemData>(gameObject1, data); ItemData itemDataByItemId = player.FindItemDataByItemID(data.iiname); DataSource.Bind <ItemData>(gameObject1, itemDataByItemId); DataSource.Bind <ItemParam>(gameObject1, MonoSingleton <GameManager> .Instance.GetItemParam(data.iiname)); ListItemEvents component = (ListItemEvents)gameObject1.GetComponent <ListItemEvents>(); if (Object.op_Inequality((Object)component, (Object)null)) { component.OnSelect = new ListItemEvents.ListItemEvent(this.OnSelect); } gameObject1.SetActive(true); } GameParameter.UpdateAll(((Component)this).get_gameObject()); }