Ejemplo n.º 1
0
    private void Start()
    {
        var module  = HuaweiPurchasingModule.Instance();
        var builder = ConfigurationBuilder.Instance(module);

        AddProducts(builder, m_subscriptions, ProductType.Subscription);
        AddProducts(builder, m_consumables, ProductType.Consumable);
        AddProducts(builder, m_nonConsumables, ProductType.NonConsumable);

        UnityPurchasing.Initialize(this, builder);
    }
Ejemplo n.º 2
0
        public void Init(LocalProduct localProduct, IIapListener listener)
        {
            _listener     = listener;
            _localProduct = localProduct;

            // If Products already installed fetch them from UnityStoreController
            if (IsInitialized())
            {
                FetchedProducts(_unityStoreController.products.all);
                _listener.OnProductsQuerySuccess();
                return;
            }

            #if HMS_BUILD && !UNITY_EDITOR
            var builder = ConfigurationBuilder.Instance(HuaweiPurchasingModule.Instance());
            #else
            var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
            #endif

            builder.AddProduct("remove_ads", ProductType.NonConsumable);
            UnityPurchasing.Initialize(this, builder);
        }