private void AddSKUToJava(AppcoinsSKU newProduct)
 {
     if (!Application.isEditor)
     {
         _class.CallStatic("addNewSku", newProduct.Name,
                           newProduct.SKUID, newProduct.Price);
     }
 }
Esempio n. 2
0
        internal static bool IgnoreSKU(List <AppcoinsSKU> products,
                                       AppcoinsSKU product)
        {
            if (product == null || product.SKUID.Equals(""))
            {
                return(true);
            }

            if (products.FindAll(
                    sku => sku.SKUID.Equals(product.SKUID)
                    ).Count > 2
                )
            {
                return(true);
            }

            return(false);
        }
Esempio n. 3
0
        public static void CheckForRepeatedSkuId(List <AppcoinsSKU> products)
        {
            for (int i = 0; i < products.Count - 1; i++)
            {
                AppcoinsSKU currentProduct = products[i];

                for (int j = i + 1; j < products.Count; j++)
                {
                    AppcoinsSKU compareProduct = products[j];

                    if (currentProduct != null && currentProduct.SKUID.Length ==
                        compareProduct.SKUID.Length
                        )
                    {
                        if (currentProduct.SKUID.Equals(compareProduct.SKUID))
                        {
                            throw new RepeatedSKUProductException();
                        }
                    }
                }
            }
        }
 public void AddSKU(AppcoinsSKU newProduct)
 {
     appcoinsUnity.AddSKU(newProduct);
 }
 internal void AddSKU(AppcoinsSKU newProduct)
 {
     products.Add(newProduct);
     AddSKUToJava(newProduct);
 }