Пример #1
0
    public virtual void init()
    {
        if (!paymentSystemAdded)
        {
#if PURCHASE_USE_APPLE_ITUNES
            productManager       = gameObject.AddComponent <StoreKitManager>();
            productEventListener = gameObject.AddComponent <StoreKitEventListener>();

            LogUtil.Log("ProductPurchase::InitPaymentSystem StoreKit/iOS added...");

            GetProducts();
#elif PURCHASE_USE_AMAZON
            productManager       = gameObject.AddComponent <AmazonIAPManager>();
            productEventListener = gameObject.AddComponent <AmazonIAPEventListener>();

            LogUtil.LogProduct("ProductPurchase::InitPaymentSystem Amazon IAP/Android added...");
#elif PURCHASE_USE_GOOGLE_PLAY
            productManager       = gameObject.AddComponent <GoogleIABManager>();
            productEventListener = gameObject.AddComponent <GoogleIABEventListener>();

            LogUtil.LogProduct("ProductPurchase::InitPaymentSystem Google Play IAB/Android added...");

            GoogleIAB.init(AppConfigs.productGoogleKey);
#elif UNITY_WEBPLAYER
            LogUtil.LogProduct("ProductPurchase::InitPaymentSystem none added...");
#else
            LogUtil.LogProduct("ProductPurchase::InitPaymentSystem none added...");
#endif

            if (productManagerObject != null)
            {
                DontDestroyOnLoad(productManagerObject);
            }

            if (productEventListenerObject != null)
            {
                DontDestroyOnLoad(productEventListenerObject);
            }

            paymentSystemAdded = true;
        }
    }
Пример #2
0
    public virtual void init()
    {
        if (!paymentSystemAdded)
        {
#if PURCHASE_USE_APPLE_ITUNES_PRIME31
            productManager       = gameObject.Set <StoreKitManager>();
            productEventListener = gameObject.Set <StoreKitEventListener>();

            LogUtil.Log("ProductNetworks::InitPaymentSystem StoreKit/iOS added...");

            GetProducts();
#elif PURCHASE_USE_AMAZON_PRIME31
            productManager       = gameObject.Set <AmazonIAPManager>();
            productEventListener = gameObject.Set <AmazonIAPEventListener>();

            LogUtil.LogProduct("ProductNetworks::InitPaymentSystem Amazon IAP/Android added...");
#elif PURCHASE_USE_GOOGLE_PLAY_PRIME31
            productManager       = gameObject.Set <GoogleIABManager>();
            productEventListener = gameObject.Set <GoogleIABEventListener>();

            LogUtil.LogProduct("ProductNetworks::InitPaymentSystem Google Play IAB/Android added...");

            GoogleIAB.init(AppConfigs.productGoogleKey);
#elif UNITY_WEBPLAYER
            LogUtil.LogProduct("ProductNetworks::InitPaymentSystem none added...");
#elif PURCHASE_USE_UNITY
            productManager = gameObject.Set <ProductNetworkUnity>();

            LogUtil.LogProduct("ProductNetworks::InitPaymentSystem Unity added...");
#else
            LogUtil.LogProduct("ProductNetworks::InitPaymentSystem none added...");
#endif

            paymentSystemAdded = true;
        }
    }