Exemple #1
0
    void OnPause()
    {
        Time.timeScale          = 0;
        GameData.Instance.Pause = true;
//		DialogManager.Instance.PopupDialog(CommonAsset.Load("prefabs/Dialogs/PauseGameDialog"));
        PauseGameDialog.Popup();
    }
Exemple #2
0
    // Update is called once per frame
    void Update()
    {
        if (!EscPressed && Input.GetKeyUp(KeyCode.Escape))
        {
            string currentLevelName = Application.loadedLevelName;

            if (currentLevelName.Contains(CHANGJING) || currentLevelName.Contains(WUJIN))
            {
                Time.timeScale          = 0;
                GameData.Instance.Pause = true;
//				DialogManager.Instance.PopupDialog(CommonAsset.Load("prefabs/Dialogs/PauseGameDialog"));
                PauseGameDialog.Popup();
            }
            else if (currentLevelName.Contains(UI))
            {
                Ultilities.CleanMemory();
                Application.LoadLevel("login");
            }
            else if (currentLevelName.Contains("chuanggan"))
            {
                Ultilities.CleanMemory();
                Application.LoadLevel("ui");
            }
            else if (currentLevelName.Contains("login"))
            {
                ExitGameDialog.Popup();
            }


            EscPressed = true;
        }
    }
Exemple #3
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }