1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class GameOverVideoAdsLife : MonoBehaviour {
- public UIButton ButtonClose;
- public UIButton ButtonNo;
- public ScreenBase Screen;
- void Start () {
- ButtonClose.onClick.Add(new EventDelegate(ClosePanel));
- ButtonNo.onClick.Add(new EventDelegate(ClosePanel));
- }
- private void ClosePanel()
- {
- Screen.Hide();
- Close();
- InGameScriptCS.Instance.UpdateScore();
- }
- // Update is called once per frame
- public void Close () {
- NGUIMenuScript.Instance.CurStatePopup = NGUIMenuScript.StatesMenuForPopup.GameOver;
- NGUIMenuScript.Instance.ShowMenu(NGUIMenuScript.NGUIMenus.GameOver);
- NGUIMenuScript.Instance.toggleHUDGroupState(false, false);
- }
- public void ShowAd()
- {
- var counter = PlayerPrefs.GetInt("AdCounter");
- if (counter < GameConstants.MAX_ADD_LIFE)
- {
- counter++;
- PlayerPrefs.SetInt("AdCounter", counter);
- PlayerPrefs.Save();
- if (!AdManager.Instance.Active)
- {
- Debug.Log("Active");
- AdManager.Instance.PlayVideoAd();
- }
- }
-
- Debug.Log("ShowAd");
-
-
-
- }
-
- }
|