Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (GvrController.AppButtonDown)
        {
            if (isShowingQuit)
            {
                return;
            }
            if (PhotonNetwork.isMasterClient && currentGamePrefab != null)
            {
                quitDialog = PopupManager.ShowDialogBelongObject(quitDialog.name, -1, currentGamePrefab.transform, FBTextManager.QUIT_GAME_MARKER);
            }
            isShowingQuit = true;
            Transform btnOkay = quitDialog.transform.findChildRecursively("BtnYES");
            Transform btnNo   = quitDialog.transform.findChildRecursively("BtnNO");

            if (btnOkay)
            {
                btnOkay.GetComponent <Button>().onClick.SetPersistentListenerState(0, UnityEngine.Events.UnityEventCallState.Off);
                btnOkay.GetComponent <Button>().onClick.AddListener(() => OnEndGame());
            }
            if (btnNo)
            {
                btnNo.GetComponent <Button>().onClick.SetPersistentListenerState(0, UnityEngine.Events.UnityEventCallState.Off);
                btnNo.GetComponent <Button>().onClick.AddListener(() => { PopupManager.DisableDialog(quitDialog); isShowingQuit = false; });
            }
        }
    }
Exemplo n.º 2
0
 public void OnEndGame()
 {
     currentGamePrefab.GetComponent <GameCore>().OnDisableGame();
     PhotonNetwork.Destroy(currentGamePrefab);
     Player.instance.SetState(Player.PlayerState.None);
     PopupManager.DisableDialog(quitDialog);
     BtnMath.SetActive(true);
     BtnHockey.SetActive(true);
     isShowingQuit = false;
 }
Exemplo n.º 3
0
 void OnDisableDialog(GameObject dialog)
 {
     PopupManager.DisableDialog(dialog);
 }
Exemplo n.º 4
0
 public void QuitDialog_YesBtnDown()
 {
     PopupManager.DisableDialog(this.gameObject);
 }
Exemplo n.º 5
0
 public void GoToLobby_NoBtnDown()
 {
     PopupManager.DisableDialog(this.gameObject);
 }
Exemplo n.º 6
0
 public void GoToLobby_YesBtnDown()
 {
     PopupManager.DisableDialog(this.gameObject);
     PhotonNetwork.LeaveRoom();
     PhotonNetwork.LoadLevel("LobbyRoom");
 }