void OnItemInGrid(PaidCurrencyBundleItem item, GameObject obj)
    {
        PremiumBundle creditBundle = obj.GetComponent <PremiumBundle>();

        creditBundle.Amount = item.Amount.ToString();
        creditBundle.Cost   = item.Cost.ToString();

        if (item.CreditPlatformIDs.ContainsKey("Android_Product_ID"))
        {
            creditBundle.ProductID = item.CreditPlatformIDs["Android_Product_ID"];
        }

        if (item.CreditPlatformIDs.ContainsKey("IOS_Product_ID"))
        {
            creditBundle.ProductID = item.CreditPlatformIDs["IOS_Product_ID"].ToString();
        }

        creditBundle.BundleID = item.ID.ToString();

        creditBundle.PremiumCurrencyName = "";
        creditBundle.Description         = item.Description;


        if (!string.IsNullOrEmpty(item.CurrencyIcon))
        {
            CloudGoods.GetItemTexture(item.CurrencyIcon, delegate(ImageStatus imageStatus, Texture2D texture)
            {
                creditBundle.SetIcon(texture);
            });
        }

        creditBundle.SetBundleName(item.BundleName);

        creditBundle.OnPurchaseRequest = OnPurchaseRequest;
    }
Ejemplo n.º 2
0
 public virtual void Init(StoreItem item, UnityUIStoreLoader unityStoreLoader)
 {
     //if (nameLabel != null) nameLabel.text = item.itemName;
     //if(descriptionLabel != null) descriptionLabel.text = item. <-- There is no description on StoreItems. This is a must have.
     storeItem   = item;
     storeLoader = unityStoreLoader;
     CloudGoods.GetItemTexture(storeItem.imageURL, OnReceivedItemTexture);
 }
    public void Start()
    {
        holdingContainer = this.transform.GetComponentInParent <ItemContainerDisplay>();
        itemObject       = this.GetComponent <ItemDataComponent>();


        SetAmountText(itemObject.itemData.stackSize.ToString());
        CloudGoods.GetItemTexture(itemObject.itemData.imageName, OnReceivedItemTexture);
        SetFrameColor(ItemQuailityColorSelector.GetColorForItem(itemObject.itemData));
    }
    public void LoadIngredient(IngredientDetail ingredientDetail, int containerAmountOfIngredient)
    {
        ingredientAmount.text = containerAmountOfIngredient + " of " + ingredientDetail.amount.ToString();

        if (containerAmountOfIngredient < ingredientDetail.amount)
        {
            ingredientAmount.color = Color.red;
        }

        CloudGoods.GetItemTexture(ingredientDetail.imgURL, OnReceivedIngredientImage);
    }
Ejemplo n.º 5
0
    public void SetupUnityUIItemBundle(ItemBundle newItemBundle, UnityUIBundlePurchasing purchasing)
    {
        itemBundle       = newItemBundle;
        bundlePurchasing = purchasing;

        CloudGoods.GetItemTexture(itemBundle.Image, OnReceivedItemTexture);

        Button button = GetComponent <Button>();

        button.onClick.AddListener(OnClickedItemBundle);
    }
Ejemplo n.º 6
0
    public void LoadItemRecipe(RecipeInfo newRecipeInfo)
    {
        recipeInfo = newRecipeInfo;

        recipeName.text = recipeInfo.name;

        recipeCraftTime.text = GetStringCraftTime(newRecipeInfo.energy);

        CloudGoods.GetItemTexture(recipeInfo.imgURL, OnReceivedRecipeImage);

        LoadIngredients(recipeInfo.IngredientDetails);
    }
    public void SetupBundleItemDisplay(BundleItem newBundleItem)
    {
        bundleItem = newBundleItem;

        ItemName.text   = bundleItem.Name;
        itemAmount.text = "Amount: " + bundleItem.Quantity;

        ItemStats.text = "";

        foreach (BundleItemDetails details in newBundleItem.bundleItemDetails)
        {
            ItemStats.text += details.BundleDetailName + " : " + details.Value + " \n";
        }

        CloudGoods.GetItemTexture(bundleItem.Image, OnReceivedItemTexture);
    }
    void SetBundleItemToDisplay(int index)
    {
        BundleItem bundleitem = itemBundle.bundleItems[index];

        ItemName.text = bundleitem.Name;

        string formated = "";

        foreach (BundleItemDetails detail in bundleitem.bundleItemDetails)
        {
            formated = string.Format("{0}{1}: {2}\n", formated, detail.BundleDetailName, detail.Value.ToString());
        }

        ItemDetails.text = formated;

        CloudGoods.GetItemTexture(bundleitem.Image, OnReceivedItemTexture);
    }
Ejemplo n.º 9
0
    public void OpenRecipeDetailsWindow(RecipeInfo recipeInfo)
    {
        bool HasEnoughResources = true;

        recipeInfoWindow.SetActive(true);

        RecipeItemName.text = recipeInfo.name;

        CloudGoods.GetItemTexture(recipeInfo.imgURL, OnReceivedRecipeItemImage);

        recipeItemDetails.text = "";

        foreach (ItemDetail itemDetail in recipeInfo.RecipeDetails)
        {
            recipeItemDetails.text += itemDetail.name + " : " + itemDetail.value + "\n";
        }

        ClearIngredients();

        foreach (IngredientDetail ingredient in recipeInfo.IngredientDetails)
        {
            GameObject ingredientObj = (GameObject)GameObject.Instantiate(IngredientPrefab);
            ingredientObj.transform.SetParent(IngredientsGrid.transform);

            HasEnoughResources = HasAvailableIngredientsForRecipe(ingredientObj, ingredient);
        }

        if (HasEnoughResources)
        {
            craftingButton.SetActive(true);
            InsufficentText.SetActive(false);
        }
        else
        {
            craftingButton.SetActive(false);
            InsufficentText.SetActive(true);
        }
    }
    public void LoadIngredient(IngredientDetail ingredientDetail)
    {
        ingredientAmount.text = ingredientDetail.amount.ToString();

        CloudGoods.GetItemTexture(ingredientDetail.imgURL, OnReceivedIngredientImage);
    }