private BillingProduct CreateProduct(string name, bool isConsumable, string id)
    {
        PlatformValue[] platformVals = new PlatformValue[]
        {
            PlatformValue.IOS(id)
        };

        return(BillingProduct.Create(name, isConsumable, platformVals));
    }
Exemple #2
0
        //converting Unity IAP product definitions into the VoxelBuster format
        private BillingProduct ConvertProduct(ProductDefinition product)
        {
            IAPObject obj = IAPManager.GetIAPObject(product.id);

            if (obj == null)
            {
                return(null);
            }

            List <VoxelBusters.NativePlugins.PlatformID> platformIds = new List <VoxelBusters.NativePlugins.PlatformID>();

            platformIds.Add(VoxelBusters.NativePlugins.PlatformID.Editor(product.id));

                        #if UNITY_ANDROID
            platformIds.Add(VoxelBusters.NativePlugins.PlatformID.Android(product.storeSpecificId));
                        #elif UNITY_IOS || UNITY_TVOS
            platformIds.Add(VoxelBusters.NativePlugins.PlatformID.IOS(product.storeSpecificId));
                        #endif

            return(BillingProduct.Create(obj.title, product.type == ProductType.Consumable ? true : false, platformIds.ToArray()));
        }