private void Selector_OnSelect(object sender, EventArgs e) { Selector.OnSelectEventArgs onSelectEventArgs = e as Selector.OnSelectEventArgs; UI_ShopItem uI_ShopItem = onSelectEventArgs.selectableObject as UI_ShopItem; if (null != uI_ShopItem) { selectedItemIndex = uI_ShopItem.GetIndex(); } }
private void CreateDisplay() { int count = shop.GetItemDatumCount(); int i; for (i = 0; i < count; i++) { Transform uI_ShopItemTransform = Instantiate(uI_ShopItemTemplate, content); uI_ShopItemTransform.gameObject.SetActive(true); uI_ShopItemTransform.GetComponent <RectTransform>().anchoredPosition = UI_ShopItemPositionInUI_Shop(i); UI_ShopItem uI_ShopItem = uI_ShopItemTransform.GetComponent <UI_ShopItem>(); uI_ShopItem.UpdateItemDatum(shop.GetItemDatum(i)); uI_ShopItem.SetIndex(i); uI_ShopItemList.Add(uI_ShopItem); } content.GetComponent <RectTransform>().sizeDelta = new Vector2(0f, SPACE_BETWEEN_ITEM * i); }