UIThanks.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using UnityEngine;
  2. using System.Collections;
  3. public class UIThanks : MonoBehaviour {
  4. public GameObject First;
  5. public GameObject Second;
  6. public static UIThanks Instance { get; private set; }
  7. private float _wait = -1;
  8. internal void Awake()
  9. {
  10. Instance = this;
  11. }
  12. internal void Start()
  13. {
  14. Instance = this;
  15. }
  16. private void OnEnable()
  17. {
  18. if (PlayerPrefs.GetInt("GetCoupon") == 1)
  19. {
  20. // Debug.Log(PlayerPrefs.GetInt("GetCoupon"));
  21. StartCoroutine(CouponePopup());
  22. }
  23. }
  24. IEnumerator CouponePopup()
  25. {
  26. yield return new WaitForSeconds(0.5f);
  27. LoginManager.Instance.CouponGetEnterNumber.Show();
  28. }
  29. void Update()
  30. {
  31. if (_wait > 0.1f && Time.timeSinceLevelLoad > _wait)
  32. {
  33. _wait = -1;
  34. //First.SetActive(false);
  35. //Second.SetActive(true);
  36. }
  37. }
  38. public void OnShow()
  39. {
  40. /*if (AdwareRequest.HasAdware)
  41. {
  42. AdwareRequest.Show();
  43. First.SetActive(true);
  44. Second.SetActive(false);
  45. StartCoroutine(ShowNext());
  46. }
  47. else
  48. {
  49. StartCoroutine(ShowNext());
  50. }*/
  51. // First.SetActive(true);
  52. //Second.SetActive(true);
  53. //_wait = Time.timeSinceLevelLoad + 3;
  54. // StartCoroutine(ShowNext());
  55. }
  56. /* private IEnumerator ShowNext()
  57. {
  58. yield return new WaitForSeconds(3f);
  59. First.SetActive(false);
  60. Second.SetActive(true);
  61. }*/
  62. }