123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using UnityEngine;
- using System.Collections;
- public class StartButtonHandler : 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)
- {
- //FacebookDialogManager.Instance.ShowAppropriateDialog();
- LoginManager.Instance.WrongConnectMessages.Show();
- return;
- }
- //if (LoginManager.Instance.OVERGAME)
- //{
- // LoginManager.Instance.OverGameMessage.Show();
- // return;
- //}
- //if (!LoginManager.Instance.Age /*|| LoginManager.Instance.OVERGAME*/)
- //{
- // return;
- //}
- // if (WrapperFB.IsLoggedIn)
- // {
- // //NGUIMenuScript.Instance.ShowMenu(NGUIMenuScript.NGUIMenus.LeaderBoardNew);
- // //NGUITools.SetActive(this.transform.parent.gameObject, false);//close/ disable the current menu
- // }
- // else
- // {
- //#if !UNITY_EDITOR
- // LoginManager.Instance.WrongMessages.Show();
- // return;
- //#endif
- // }
- //Debug.Log(!InstructionsHomeButtonHandler.FirstPlay);
- /*if (!InstructionsHomeButtonHandler.FirstPlay)
- {
- NGUIMenuScript.Instance.CurStatePopup = NGUIMenuScript.StatesMenuForPopup.None;
- hInGameScriptCS.launchGame(); //start the gameplay
- //hNGUIMenuScript.NGUIMenuScriptEnabled(false);//turn off the NGUI Menu Script (to improve performance)
- }
- else
- {
- NGUIMenuScript.Instance.CurStatePopup = NGUIMenuScript.StatesMenuForPopup.None;
- hInGameScriptCS.launchGame(); //start the gameplay
-
- }*/
- NGUIMenuScript.Instance.CurStatePopup = NGUIMenuScript.StatesMenuForPopup.ChangeLevel;
- NGUIMenuScript.Instance.ShowMenu(NGUIMenuScript.NGUIMenus.ChangeLevel);
- //NGUIMenuScript.Instance.toggleHUDGroupState(false);
- //hInGameScriptCS.launchGame(); //start the gameplay
- if (UISendGreetings.Visible)
- {
- return;
- }
- //NGUIMenuScript.Instance.ShowMenu(NGUIMenuScript.NGUIMenus.RaceStart);
- NGUITools.SetActive(this.transform.parent.gameObject, false);//close/ disable the current menu*/
- }
- }
|