Пример #1
0
            private IAPButtonStoreManager()
            {
                catalog = ProductCatalog.LoadDefaultCatalog();

                StandardPurchasingModule module = StandardPurchasingModule.Instance();

                module.useFakeStoreUIMode = FakeStoreUIMode.StandardUser;

                ConfigurationBuilder builder = ConfigurationBuilder.Instance(module);

                foreach (var product in catalog.allProducts)
                {
                    if (product.allStoreIDs.Count > 0)
                    {
                        var ids = new IDs();
                        foreach (var storeID in product.allStoreIDs)
                        {
                            ids.Add(storeID.id, storeID.store);
                        }
                        builder.AddProduct(product.id, product.type, ids);
                    }
                    else
                    {
                        builder.AddProduct(product.id, product.type);
                    }
                }
                UnityPurchasing.Initialize(this, builder);
            }
Пример #2
0
 void Restore()
 {
     if (buttonType == ButtonType.Restore)
     {
         if (Application.platform == RuntimePlatform.WSAPlayerX86 ||
             Application.platform == RuntimePlatform.WSAPlayerX64 ||
             Application.platform == RuntimePlatform.WSAPlayerARM)
         {
             CodelessIAPStoreListener.Instance.ExtensionProvider.GetExtension <IMicrosoftExtensions>()
             .RestoreTransactions();
         }
         else if (Application.platform == RuntimePlatform.IPhonePlayer ||
                  Application.platform == RuntimePlatform.OSXPlayer ||
                  Application.platform == RuntimePlatform.tvOS)
         {
             CodelessIAPStoreListener.Instance.ExtensionProvider.GetExtension <IAppleExtensions>()
             .RestoreTransactions(OnTransactionsRestored);
         }
         else if (Application.platform == RuntimePlatform.Android &&
                  StandardPurchasingModule.Instance().appStore == AppStore.SamsungApps)
         {
             CodelessIAPStoreListener.Instance.ExtensionProvider.GetExtension <ISamsungAppsExtensions>()
             .RestoreTransactions(OnTransactionsRestored);
         }
         else
         {
             Debug.LogWarning(Application.platform.ToString() +
                              " is not a supported platform for the Codeless IAP restore button");
         }
     }
 }
 void Restore()
 {
     if (buttonType == ButtonType.Restore)
     {
         if (Application.platform == RuntimePlatform.WSAPlayerX86 || Application.platform == RuntimePlatform.WSAPlayerX64 || Application.platform == RuntimePlatform.WSAPlayerARM)
         {
             IAPButtonStoreManager.Instance.ExtensionProvider.GetExtension <IMicrosoftExtensions>().RestoreTransactions();
         }
         else if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.tvOS)
         {
             IAPButtonStoreManager.Instance.ExtensionProvider.GetExtension <IAppleExtensions>().RestoreTransactions(OnTransactionsRestored);
         }
         else if (Application.platform == RuntimePlatform.Android && StandardPurchasingModule.Instance().androidStore == AndroidStore.SamsungApps)
         {
             IAPButtonStoreManager.Instance.ExtensionProvider.GetExtension <ISamsungAppsExtensions>().RestoreTransactions(OnTransactionsRestored);
         }
         else if (Application.platform == RuntimePlatform.Android && StandardPurchasingModule.Instance().androidStore == AndroidStore.CloudMoolah)
         {
             IAPButtonStoreManager.Instance.ExtensionProvider.GetExtension <IMoolahExtension>().RestoreTransactionID((restoreTransactionIDState) => {
                 OnTransactionsRestored(restoreTransactionIDState != RestoreTransactionIDState.RestoreFailed && restoreTransactionIDState != RestoreTransactionIDState.NotKnown);
             });
         }
         else
         {
             Debug.LogWarning(Application.platform.ToString() + " is not a supported platform for the Codeless IAP restore button");
         }
     }
 }
Пример #4
0
        private static void InitializePurchasing()
        {
            StandardPurchasingModule module = StandardPurchasingModule.Instance();

            module.useFakeStoreUIMode = FakeStoreUIMode.StandardUser;

            ConfigurationBuilder builder = ConfigurationBuilder.Instance(module);

            IAPConfigurationHelper.PopulateConfigurationBuilder(ref builder, instance.catalog);

            UnityPurchasing.Initialize(instance, builder);

            unityPurchasingInitialized = true;
        }
Пример #5
0
            private IAPButtonStoreManager()
            {
                catalog = ProductCatalog.LoadDefaultCatalog();

                StandardPurchasingModule module = StandardPurchasingModule.Instance();

                module.useFakeStoreUIMode = FakeStoreUIMode.StandardUser;

                ConfigurationBuilder builder = ConfigurationBuilder.Instance(module);

                IAPConfigurationHelper.PopulateConfigurationBuilder(ref builder, catalog);

                UnityPurchasing.Initialize(this, builder);
            }