NoLivesLeftDialog.cs 964 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using UnityEngine;
  2. using System.Collections;
  3. using System;
  4. public class NoLivesLeftDialog : MonoBehaviour
  5. {
  6. ScreenBase screen;
  7. void Awake()
  8. {
  9. screen = GetComponent<ScreenBase>();
  10. //MediaPlayerCtrl.Instance.OnEnd += OnEnd;
  11. }
  12. /*public void OnEnd()
  13. {
  14. Debug.Log("OnEnd");
  15. LivesManager.Instance.RechargeOneLife();
  16. }*/
  17. void OnRequestLivesAdButtonMsg()
  18. {
  19. screen.Hide();
  20. }
  21. void OnHide()
  22. {
  23. screen.Hide();
  24. }
  25. void OnRequestInvite()
  26. {
  27. WrapperFB.InviteFriends();
  28. }
  29. void OnBuyLivesButtonMsg()
  30. {
  31. StoreManager.Instance.Purchase(StoreProductId.lives_5);
  32. }
  33. void OnRequestShowAdButton()
  34. {
  35. //screen.Hide();
  36. if (!ConnectivityPollManager.HasInternet)
  37. {
  38. MenuManager._instance.scoresScreen.GetComponent<FacebookDialogManager>().noInternetDialog.Show();
  39. return;
  40. }
  41. MediaPlayerCtrl.Instance.PlayAd();
  42. }
  43. }