Ejemplo n.º 1
0
 public void AddCurrency(StoreItem item)
 {
     if (VirtualCurrencyBalancePrefab == null)
     {
         Debug.LogError("VirtualCurrencyBalancePrefab is missing!");
         return;
     }
     if (!currencies.ContainsKey(item.sku) && item.image_url != null)
     {
         GameObject currencyBalance         = Instantiate(VirtualCurrencyBalancePrefab, transform);
         VirtualCurrencyBalanceUI balanceUI = currencyBalance?.GetComponent <VirtualCurrencyBalanceUI>();
         currencies.Add(item.sku, balanceUI);
         balanceUI.Initialize(item);
     }
 }
Ejemplo n.º 2
0
    private VirtualCurrencyBalanceUI AddCurrency(CatalogVirtualCurrencyModel item)
    {
        if (_currencies.ContainsKey(item.CurrencySku))
        {
            return(_currencies[item.CurrencySku]);
        }
        if (string.IsNullOrEmpty(item.ImageUrl))
        {
            return(null);
        }
        GameObject currencyBalance         = Instantiate(virtualCurrencyBalancePrefab, transform);
        VirtualCurrencyBalanceUI balanceUi = currencyBalance.GetComponent <VirtualCurrencyBalanceUI>();

        balanceUi.Initialize(item);
        _currencies.Add(item.CurrencySku, balanceUi);
        return(balanceUi);
    }