// 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; }); } } }
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; }
void OnDisableDialog(GameObject dialog) { PopupManager.DisableDialog(dialog); }
public void QuitDialog_YesBtnDown() { PopupManager.DisableDialog(this.gameObject); }
public void GoToLobby_NoBtnDown() { PopupManager.DisableDialog(this.gameObject); }
public void GoToLobby_YesBtnDown() { PopupManager.DisableDialog(this.gameObject); PhotonNetwork.LeaveRoom(); PhotonNetwork.LoadLevel("LobbyRoom"); }