#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); } }
protected virtual void OnDestroy() { DialogManager.UnregisterDialog(this); }
private static void ToggleFps() { DialogManager.GetDialog <DebugMenu>().ToggleFPS(); }