NoLivesLeftDialog.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 OnRequestLivesButtonMsg()
  18. {
  19. screen.Hide();
  20. FacebookHelper.Instance.RequestLives();
  21. }
  22. void OnRequestLivesAdButtonMsg()
  23. {
  24. screen.Hide();
  25. }
  26. void OnHide()
  27. {
  28. screen.Hide();
  29. }
  30. void OnRequestInvite()
  31. {
  32. WrapperFB.InviteFriends();
  33. }
  34. void OnBuyLivesButtonMsg()
  35. {
  36. StoreManager.Instance.Purchase(StoreProductId.lives_5);
  37. }
  38. public void OnRequestShowAdButton()
  39. {
  40. //screen.Hide();
  41. if (!ConnectivityPollManager.HasInternet)
  42. {
  43. MenuManager._instance.scoresScreen.GetComponent<FacebookDialogManager>().noInternetDialog.Show();
  44. return;
  45. }
  46. PlayerPrefs.SetInt("PlayAdForLifes", 1);
  47. PlayerPrefs.Save();
  48. MenuManager._instance.VideoAd.Show();
  49. VideoManager.Instance.PlayAd();
  50. screen.Hide();
  51. //MediaPlayerCtrl.Instance.PlayAd();
  52. }
  53. }