Пример #1
0
        public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs purchaseEvent)
        {
            if (_AllProducts.Contains(purchaseEvent.purchasedProduct.definition.id, StringComparer.Ordinal))
            {
                Debug.Log($"ProcessPurchase: PASS. Product: '{purchaseEvent.purchasedProduct.definition.id}'");

                var match = Regex.Match(purchaseEvent.purchasedProduct.definition.id, @"(\w+)_set$");

                if (match.Success && match.Groups[1].Success)
                {
                    AndroidNativeWrapper.CallMethod("ShowToast", new object[] { purchaseEvent.purchasedProduct.definition.id, 0 });
                    EncryptedGlobalPreferences.SetPrimitive($"{match.Value}_activated", true);
                    EncryptedGlobalPreferences.SetPrimitive($"any_set_activated", true);
                }
                else
                {
                    /*
                     * switch (purchaseEvent.purchasedProduct.definition.id)
                     * {
                     *
                     * }
                     */
                }
            }
            else
            {
                Debug.Log($"ProcessPurchase: FAIL. Unrecognized product: '{purchaseEvent.purchasedProduct.definition.id}'");
            }

            return(PurchaseProcessingResult.Complete);
        }
Пример #2
0
        public void ShowDetails()
        {
            var oper = LocalizationSettings.StringDatabase.GetLocalizedStringAsync("Base", "store_purchase_warning");

            oper.Completed += (oper) =>
            {
                AndroidNativeWrapper.CallMethod("ShowToast", new object[] { oper.Result, 0 });
            };
        }
Пример #3
0
 public void SaveLevel()
 {
     Saver.Instance.SaveCurrentLevel();
     AndroidNativeWrapper.CallMethod("ShowToast", new object[] { "Level saved", 0 });
 }