StoreManager.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using UnityEngine;
  2. using System.Collections.Generic;
  3. public class StoreManager : GenericStoreManager<StoreProductId>
  4. {
  5. public ScreenBase progressIndicator;
  6. public override string GetAndroidKey()
  7. {
  8. return "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0c81kDu1X9i9cIPgFPhYYp99cnzi19yFZmO/RLkB5WNnJTE/iXmR+J7pF0gyTR5H83MpZtK4zMvo/ZtnPgmzaASbg2njYFxpNpt8XEmDv2/6ZoOvB6dZKbnnNd/Admjs/gTnGrtLza1uvXBNvefkw6PCV8dktjmLI6GuADiXobO+lmWygADKlFxN+nxY2gmEjBW0Z+FHASTAl82U7PxW+sbjfmuMQiehMKCqI99LLd/Xu5pWh66danvuJNT4+kmOr2rzrKkXisVyuKreoabp2R/cgu5HlLQyss1Na5ydorMDVWW0Rdvggd/4kugoYhFYr3U2qwc67iQdcX28a0wpQQIDAQAB";
  9. }
  10. protected override void Start()
  11. {
  12. base.Start();
  13. CoreNotificationCenter.AddListener(OnPurchaseInProgress, CoreNotificationType.PurchaseInProgress);
  14. CoreNotificationCenter.AddListener(OnPurchaseFinished, CoreNotificationType.PurchaseSuccessful);
  15. CoreNotificationCenter.AddListener(OnPurchaseFinished, CoreNotificationType.PurchaseFailed);
  16. }
  17. void OnDestroy()
  18. {
  19. CoreNotificationCenter.RemoveListener(OnPurchaseInProgress, CoreNotificationType.PurchaseInProgress);
  20. CoreNotificationCenter.RemoveListener(OnPurchaseFinished, CoreNotificationType.PurchaseSuccessful);
  21. CoreNotificationCenter.RemoveListener(OnPurchaseFinished, CoreNotificationType.PurchaseFailed);
  22. }
  23. void OnPurchaseInProgress(CoreNotification note)
  24. {
  25. progressIndicator.Show();
  26. }
  27. void OnPurchaseFinished(CoreNotification note)
  28. {
  29. progressIndicator.Hide();
  30. }
  31. }