Esempio n. 1
0
        private Purchase DrawOnePurchase(Rect position, Purchase purchase, int index)
        {
            if (purchase == null)
            {
                return(null);
            }

            float xOffset = position.x;

            DrawType(new Rect(xOffset, position.y, position.width * PurchaseTypeWidth - 1, position.height),
                     purchase, index);
            xOffset += position.width * PurchaseTypeWidth;
            if (purchase.Type == PurchaseType.PurchaseWithMarket)
            {
                DrawMarketID(new Rect(xOffset, position.y, position.width * PurchaseAssociatedWidth - 1, position.height),
                             purchase);
            }
            else
            {
                ItemPopupDrawer drawer = index < _purchasePopupDrawers.Count ? _purchasePopupDrawers[index] : null;
                if (drawer != null)
                {
                    purchase.VirtualCurrencyID = drawer.Draw(new Rect(xOffset, position.y,
                                                                      position.width * PurchaseAssociatedWidth - 1, position.height), purchase.VirtualCurrencyID, GUIContent.none);
                }
            }
            xOffset += position.width * PurchaseAssociatedWidth;
            DrawPrice(new Rect(xOffset, position.y, position.width * PurchasePriceWidth - 1, position.height), purchase);

            return(purchase);
        }
Esempio n. 2
0
        private void DrawVirtualItem(Rect position, PackElement packElement, int index)
        {
            ItemPopupDrawer drawer = index < _itemPopupDrawers.Count ? _itemPopupDrawers[index] : null;

            if (drawer != null)
            {
                packElement.ItemID = drawer.Draw(new Rect(position.x, position.y, position.width * 0.5f - 1, position.height),
                                                 packElement.ItemID, GUIContent.none);
            }
        }