Beispiel #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; });
            }
        }
    }
Beispiel #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;
 }
Beispiel #3
0
 void OnDisableDialog(GameObject dialog)
 {
     PopupManager.DisableDialog(dialog);
 }
Beispiel #4
0
 public void QuitDialog_YesBtnDown()
 {
     PopupManager.DisableDialog(this.gameObject);
 }
Beispiel #5
0
 public void GoToLobby_NoBtnDown()
 {
     PopupManager.DisableDialog(this.gameObject);
 }
Beispiel #6
0
 public void GoToLobby_YesBtnDown()
 {
     PopupManager.DisableDialog(this.gameObject);
     PhotonNetwork.LeaveRoom();
     PhotonNetwork.LoadLevel("LobbyRoom");
 }