예제 #1
0
        private void ShowSignUpDialog()
        {
            this.Dialog.Hide();

            this.ExecuteDelayed(0.25f, () =>
            {
                DialogManager.GetDialog <SignUpDialog>().Show(this.infoRequestParams, this.emailInputField.text);
            });
        }
예제 #2
0
        public IEnumerator LoginWithEmailAndPasswordDialog(GetPlayerCombinedInfoRequestParams infoRequestParams = null)
        {
            if (PF.Login.HasEverLoggedIn)
            {
                if (PF.Login.AutoLoginWithDeviceId)
                {
                    var login = PF.Login.LoginWithDeviceId(false, PF.Login.DeviceId, infoRequestParams);

                    yield return(login);

                    if (login.HasError)
                    {
                        DialogManager.GetDialog <LogInDialog>().Show(infoRequestParams);
                    }
                    else if (PF.Login.IsLoggedIn)
                    {
                        yield break;
                    }
                    else
                    {
                        // NOTE [bgish]: This should never happen, but catching this case just in case
                        Debug.LogError("LoginHelper.LoginWithDeviceId failed, but didn't correctly report the error.");
                        DialogManager.GetDialog <LogInDialog>().Show(infoRequestParams);
                    }
                }
                else
                {
                    DialogManager.GetDialog <LogInDialog>().Show(infoRequestParams);
                }
            }
            else
            {
                DialogManager.GetDialog <SignUpDialog>().Show(infoRequestParams);
            }

            while (PF.Login.IsLoggedIn == false)
            {
                yield return(null);
            }
        }
        private void ListenForXRKeyboard()
        {
            this.StartCoroutine(Coroutine());

            IEnumerator Coroutine()
            {
                XRKeyboard xrKeyboard = DialogManager.GetDialog <XRKeyboard>();

                while (true)
                {
                    if (InputFieldTracker.IsInputFieldSelected && xrKeyboard.Dialog.IsHidden)
                    {
                        xrKeyboard.Dialog.Show();
                    }

                    // NOTE [bgish]: This is important and kinda hacky, we need to call InputFieldTracker.IsInputFieldSelected every
                    //               frame if we want to properly track the last known selection of the text input.  We only care
                    //               though if the keyboard dialog is showing, else we can just check every quarter second.
                    yield return(xrKeyboard.Dialog.IsShowing ? null : WaitForUtil.Seconds(0.25f));
                }
            }
        }
예제 #4
0
#pragma warning restore 0649

        public override void Initialize()
        {
            if (this.developmentBuildsOnly == false || Application.isEditor || Debug.isDebugBuild)
            {
                this.StartCoroutine(InitializeSettings());
            }
            else
            {
                this.SetInstance(this);
            }

            IEnumerator InitializeSettings()
            {
                yield return(DialogManager.WaitForInitialization());

                var debugMenu = DialogManager.GetDialog <DebugMenu>();

                debugMenu.SetSettings(this.settings);

                if (this.showAppVersionInLowerLeftKey)
                {
                    debugMenu.SetText(Corner.LowerLeft, RuntimeBuildConfig.Instance.VersionAndCommitId);
                }

                if (this.showPlayFabIdInLowerRight)
                {
                    #if USING_PLAYFAB
                    PlayFab.PlayFabManager.OnInitialized += () =>
                    {
                        if (PlayFab.PlayFabManager.Instance.Login.IsLoggedIn)
                        {
                            var debugMenu = DialogManager.GetDialog <DebugMenu>();
                            var playfabId = PlayFab.PlayFabManager.Instance.Login.IsLoggedIn ? PlayFab.PlayFabManager.Instance.User.PlayFabId : "Login Error!";
                            debugMenu.SetText(Corner.LowerRight, playfabId);
                        }
                    };
                    #endif
                }

                if (this.showTestAd)
                {
                    debugMenu.AddItem("Show Test Ad", ShowTestAd);
                }

                if (this.showToggleFps)
                {
                    debugMenu.AddItem("Toggle FPS", ToggleFps);
                }

                if (this.showPrintAdsInfo)
                {
                    debugMenu.AddItem("Print Ads Info", PrintAdsInfo);
                }

                if (this.addRebootButton)
                {
                    debugMenu.AddItem("Reboot", Bootloader.Reboot);
                }

                debugMenu.Dialog.Show();

                this.SetInstance(this);
            }
        }
예제 #5
0
 private static void ToggleFps()
 {
     DialogManager.GetDialog <DebugMenu>().ToggleFPS();
 }