1234567891011121314151617181920212223242526272829303132 |
- using UnityEngine;
- using System.Collections;
- public class TopButtonHandler : MonoBehaviour {
- private InGameScriptCS hInGameScriptCS;
- private NGUIMenuScript hNGUIMenuScript;
- void Start()
- {
- hInGameScriptCS = (InGameScriptCS)GameObject.Find("Player").GetComponent(typeof(InGameScriptCS));
- hNGUIMenuScript = (NGUIMenuScript)GameObject.Find("UI Root (2D)").GetComponent(typeof(NGUIMenuScript));
- }
- void OnClick()
- {
- if (!ConnectivityPollManager.HasInternet)
- {
- LoginManager.Instance.WrongConnectMessages.Show();
- //FacebookDialogManager.Instance.ShowAppropriateDialog();
- hNGUIMenuScript.CloseMenu(NGUIMenuScript.NGUIMenus.MainMenuNew);
- return;
- }
- NGUIMenuScript.Instance.ShowMenu(NGUIMenuScript.NGUIMenus.LeaderBoardNew);
- NGUITools.SetActive(this.transform.parent.gameObject, false);//close/ disable the current menu
- }
- }
|