CloseOnPurchaseSuccessful.cs 495 B

12345678910111213141516171819202122
  1. using UnityEngine;
  2. using System.Collections;
  3. [RequireComponent(typeof(ScreenBase))]
  4. public class CloseOnPurchaseSuccessful : MonoBehaviour
  5. {
  6. void OnEnable()
  7. {
  8. CoreNotificationCenter.AddListener(OnPurchaseSuccessful, CoreNotificationType.PurchaseSuccessful);
  9. }
  10. void OnDisable()
  11. {
  12. CoreNotificationCenter.RemoveListener(OnPurchaseSuccessful, CoreNotificationType.PurchaseSuccessful);
  13. }
  14. void OnPurchaseSuccessful(CoreNotification note)
  15. {
  16. GetComponent<ScreenBase>().Hide();
  17. }
  18. }