예제 #1
0
        protected override void OnBackButtonPressed()
        {
            CoroutineRunner.Instance.StartCoroutine(LeaveGameCoroutine());

            IEnumerator LeaveGameCoroutine()
            {
                if (this.isLeaveGameCoroutineRunning)
                {
                    yield break;
                }

                this.isLeaveGameCoroutineRunning = true;

                this.Dialog.Hide();

                yield return(WaitForUtil.Seconds(0.25f));

                var leaveGamePrompt = PlayFabMessages.ShowExitAppPrompt();

                yield return(leaveGamePrompt);

                if (leaveGamePrompt.Value == YesNoResult.Yes)
                {
                    Platform.QuitApplication();
                    yield break;
                }

                this.Dialog.Show();

                this.isLeaveGameCoroutineRunning = false;
            }
        }
예제 #2
0
        private void ForgotPassword()
        {
            CoroutineRunner.Instance.StartCoroutine(ForgotPasswordCoroutine());

            IEnumerator ForgotPasswordCoroutine()
            {
                if (this.isForgotPasswordCoroutineRunning)
                {
                    yield break;
                }

                this.isForgotPasswordCoroutineRunning = true;

                this.Dialog.Hide();
                yield return(WaitForUtil.Seconds(.25f));

                var forgot = PlayFabMessages.ShowForgotPasswordPrompt(this.emailInputField.text);

                if (forgot.Value == YesNoResult.Yes)
                {
                    var accountRecovery = this.loginManager.SendAccountRecoveryEmail(this.emailInputField.text, this.forgotEmailTemplateId);

                    yield return(accountRecovery);

                    if (accountRecovery.HasError)
                    {
                        yield return(PlayFabMessages.HandleError(accountRecovery.Exception));
                    }
                }

                this.Dialog.Show();

                this.isForgotPasswordCoroutineRunning = false;
            }
        }