1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- using UnityEngine;
- using System.Collections;
- public class CouponUsed : MonoBehaviour {
- public UILabel LabelMessage;
- public UIButton CloseButton;
- void Start()
- {
- StartCoroutine(AlphaActive());
-
- CloseButton.onClick.Add(new EventDelegate(OnClose));
- }
- public IEnumerator AlphaActive()
- {
- yield return new WaitForSeconds(1f);
- GetComponent<UIPanel>().alpha = 1;
- GetComponent<ScreenBase>().Hide();
- yield return new WaitForSeconds(1f);
- LoginManager.Instance.BackMessageCoupone.SetActive(true);
- }
- private void OnClose()
- {
-
-
- if (NGUIMenuScript.Instance.CurStatePopup == NGUIMenuScript.StatesMenuForPopup.Menu)
- {
- foreach (var b in LoginManager.Instance.ButtonsCoupon)
- {
- if (b.gameObject.activeSelf)
- {
- b.DeactivateButton();
- }
- }
- PlayerPrefs.SetInt("CloseEnterNumber", 0);
- PlayerPrefs.SetInt("GetCoupon", 0);
- Debug.LogWarning("SendCouponFlse");
- }
- else if (NGUIMenuScript.Instance.CurStatePopup == NGUIMenuScript.StatesMenuForPopup.GameOver)
- {
- foreach (var b in LoginManager.Instance.ButtonsCoupon)
- {
- if (b.gameObject.activeSelf)
- {
- b.DeactivateButton();
- }
- }
- PlayerPrefs.SetInt("CloseEnterNumber", 0);
- PlayerPrefs.SetInt("GetCoupon", 0);
- Debug.LogWarning("SendCouponFlse");
-
- }
- else
- {
- //GetComponent<ButtonWithTwoStates>().DeactivateButton();
- //NGUIMenuScript.Instance.ShowMenu(NGUIMenuScript.NGUIMenus.SendCoupone);
- foreach (var b in LoginManager.Instance.ButtonsCoupon)
- {
- if (b.gameObject.activeSelf)
- {
- b.DeactivateButton();
- }
- }
- PlayerPrefs.SetInt("CloseEnterNumber", 0);
- PlayerPrefs.SetInt("GetCoupon", 0);
- LoginManager.Instance.OnClickOkLevelDone();
- }
- GetComponent<ScreenBase>().Hide();
- }
- }
|