Пример #1
0
    private void AddButtons()
    {
        for (int i = 0; i < itemList.Count; i++)
        {
            ShopScrollItem item = itemList[i];

            GameObject newButton = ObjectPool.GetObject(); //Pool에서 가져온다.
            newButton.transform.SetParent(contentPanel);
            newButton.transform.localScale = new Vector3(1, 1, 1);

            ShopScrollElement element = newButton.GetComponent <ShopScrollElement>();
            element.Setup(item, this); // 초기화.
        }
    }
Пример #2
0
    public void TryTransferItemToOtherShop(ShopScrollElement item)
    {
/*
 *      if (otherShop.gold >= item.price)
 *      {
 *          gold += item.price;
 *          otherShop.gold -= item.price;
 *
 *          AddItem(item, otherShop);
 *          RemoveItem(item, this);
 *
 *          RefreshDisplay();
 *          otherShop.RefreshDisplay();
 *          Debug.Log("enough gold");
 *      }
 */
        Debug.Log("attempted");
    }