Esempio n. 1
0
 public void SetInfo(ProductDataController.ProductData productData)
 {
     if (productData == null ||
         productData.Type == null)
     {
         Destroy(gameObject);
         return;
     }
     this.productData = productData;
     if (productData.ProductID.Equals("com.gobigame.junglefruitsplash.gem.2.9"))
     {
         iconTexture.mainTexture = Resources.Load <Texture2D> ("gem_1");
     }
     else if (productData.ProductID.Equals("com.gobigame.junglefruitsplash.gem.29.9"))
     {
         iconTexture.mainTexture = Resources.Load <Texture2D> ("gem_2");
     }
     else if (productData.ProductID.Equals("com.gobigame.junglefruitsplash.gem.4.9"))
     {
         iconTexture.mainTexture = Resources.Load <Texture2D> ("gem_3");
     }
     else if (productData.ProductID.Equals("com.gobigame.junglefruitsplash.gem.9.9"))
     {
         iconTexture.mainTexture = Resources.Load <Texture2D> ("gem_4");
     }
     else if (productData.ProductID.Equals("com.gobigame.junglefruitsplash.star.2.9"))
     {
         iconTexture.mainTexture = Resources.Load <Texture2D> ("star_1");
     }
     else if (productData.ProductID.Equals("com.gobigame.junglefruitsplash.star.4.9"))
     {
         iconTexture.mainTexture = Resources.Load <Texture2D> ("star_2");
     }
     else if (productData.ProductID.Equals("com.gobigame.junglefruitsplash.star.9.9"))
     {
         iconTexture.mainTexture = Resources.Load <Texture2D> ("star_3");
     }
     else if (productData.ProductID.Equals("com.gobigame.junglefruitsplash.star.29.9"))
     {
         iconTexture.mainTexture = Resources.Load <Texture2D> ("star_4");
     }
     if (productData.Type.Equals("Gem"))
     {
         iconTypeTexture.mainTexture = Resources.Load <Texture2D> ("gem_icon");
     }
     else if (productData.Type.Equals("Star"))
     {
         iconTypeTexture.mainTexture = Resources.Load <Texture2D> ("star_icon");
     }
     valueLabel.text = productData.Value.ToString();
     priceLabel.text = "$" + productData.Price.ToString();
 }
    public void SetInfo(ProductDataController.ProductData productData)
    {
        this.productData = productData;

        if (productData.Type == "Gem")
        {
            iconTypeTexture.mainTexture = Resources.Load <Texture2D>("Textures/UI/gem_icon");
        }
        else if (productData.Type == "Star")
        {
            iconTypeTexture.mainTexture = Resources.Load <Texture2D>("Textures/UI/star_icon");
        }

        iconTexture.mainTexture = Resources.Load <Texture2D>("Textures/UI/Menu/ProductsIcon/" + productData.ProductID);
        valueLabel.text         = productData.Value.ToString();
        priceLabel.text         = "$" + productData.Price.ToString();
    }