TopButtonHandler.cs 884 B

1234567891011121314151617181920212223242526272829303132
  1. using UnityEngine;
  2. using System.Collections;
  3. public class TopButtonHandler : MonoBehaviour {
  4. private InGameScriptCS hInGameScriptCS;
  5. private NGUIMenuScript hNGUIMenuScript;
  6. void Start()
  7. {
  8. hInGameScriptCS = (InGameScriptCS)GameObject.Find("Player").GetComponent(typeof(InGameScriptCS));
  9. hNGUIMenuScript = (NGUIMenuScript)GameObject.Find("UI Root (2D)").GetComponent(typeof(NGUIMenuScript));
  10. }
  11. void OnClick()
  12. {
  13. if (!ConnectivityPollManager.HasInternet)
  14. {
  15. LoginManager.Instance.WrongConnectMessages.Show();
  16. //FacebookDialogManager.Instance.ShowAppropriateDialog();
  17. hNGUIMenuScript.CloseMenu(NGUIMenuScript.NGUIMenus.MainMenuNew);
  18. return;
  19. }
  20. NGUIMenuScript.Instance.ShowMenu(NGUIMenuScript.NGUIMenus.LeaderBoardNew);
  21. NGUITools.SetActive(this.transform.parent.gameObject, false);//close/ disable the current menu
  22. }
  23. }