1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using UnityEngine;
- using System.Collections;
- public class GameOverButtonHandler : MonoBehaviour {
- private NGUIMenuScript hNGUIMenuScript;
- void Start()
- {
- hNGUIMenuScript = (NGUIMenuScript)GameObject.Find("UI Root (2D)").GetComponent(typeof(NGUIMenuScript));
- }
- void OnClick()
- {
- if (LoginManager.Instance.OverCoupone())
- {
- if (LoginManager.Instance.CouponGetEnterNumber != null)
- {
- Destroy(LoginManager.Instance.CouponGetEnterNumber.gameObject);
- }
-
- NGUIMenuScript.Instance.CurStatePopup = NGUIMenuScript.StatesMenuForPopup.GameOver;
- hNGUIMenuScript.ShowMenu(NGUIMenuScript.NGUIMenus.GameOver);
- this.transform.parent.parent.gameObject.GetComponent<ScreenBase>().Hide();
- foreach (var l in LoginManager.Instance.CouponeObjects)
- {
- l.gameObject.SetActive(false);
- }
- LoginManager.Instance.AnchorGameOverBack.relativeOffset = new Vector2(0.0f, 0.08f);
- }
- else
- {
- if (PlayerPrefs.GetInt("GetCoupon") == 1)
- {
- // Debug.Log("CouponGetEnterNumber.Show()");
- LoginManager.Instance.CouponGetEnterNumber.Show();
- NGUIMenuScript.Instance.CurStatePopup = NGUIMenuScript.StatesMenuForPopup.GameOver;
- hNGUIMenuScript.ShowMenu(NGUIMenuScript.NGUIMenus.GameOver);
- this.transform.parent.parent.parent.parent.gameObject.GetComponent<ScreenBase>().Hide();
- }
- else
- {
- NGUIMenuScript.Instance.CurStatePopup = NGUIMenuScript.StatesMenuForPopup.GameOver;
- hNGUIMenuScript.ShowMenu(NGUIMenuScript.NGUIMenus.GameOver);
- this.transform.parent.parent.parent.parent.gameObject.GetComponent<ScreenBase>().Hide();
- }
- }
-
-
- }
- }
|