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); }
public void ShowDetails() { var oper = LocalizationSettings.StringDatabase.GetLocalizedStringAsync("Base", "store_purchase_warning"); oper.Completed += (oper) => { AndroidNativeWrapper.CallMethod("ShowToast", new object[] { oper.Result, 0 }); }; }
public void SaveLevel() { Saver.Instance.SaveCurrentLevel(); AndroidNativeWrapper.CallMethod("ShowToast", new object[] { "Level saved", 0 }); }