static void LoadNextMenu(MalformedGameMenu.Reason state) { // Check the build state if (state == MalformedGameMenu.Reason.None) { // Get the scene manager to change scenes Singleton.Get <SceneTransitionManager>().LoadMainMenu(); } else { // Show the malformed menu MalformedGameMenu menu = Singleton.Get <MenuManager>().Show <MalformedGameMenu>(); // Update the reasoning menu.UpdateReason(state); } }
IEnumerator DelayedFadeOut() { float startTime = Time.realtimeSinceStartup; buildState = MalformedGameMenu.Reason.None; // Show the Malformed game menu if there's any problems yield return(StartCoroutine(VerifyBuild())); // Check how much time has passed float logoDisplayDuration = minimumLogoDisplayDuration - (Time.realtimeSinceStartup - startTime); if (logoDisplayDuration > 0) { // Wait for the designated time yield return(new WaitForSeconds(logoDisplayDuration)); } // Check the build state LoadNextMenu(buildState); }
IEnumerator VerifyBuild() { if (Singleton.Instance.IsWebApp == true) { // Grab the web checker WebLocationChecker webChecker = Singleton.Get <WebLocationChecker>(); if (webChecker != null) { // Wait until the webchecker is done while (webChecker.CurrentState == WebLocationChecker.State.InProgress) { yield return(null); } // Check the state switch (webChecker.CurrentState) { case WebLocationChecker.State.EncounteredError: buildState = MalformedGameMenu.Reason.CannotConfirmDomain; break; case WebLocationChecker.State.DomainDidntMatch: buildState = MalformedGameMenu.Reason.IsIncorrectDomain; break; } } } else if ((Application.genuineCheckAvailable == true) && (Application.genuine == false)) { buildState = MalformedGameMenu.Reason.IsNotGenuine; } // Check if we're simulating failure if (Singleton.Instance.IsSimulatingMalformedGame == true) { // Indicate as such buildState = MalformedGameMenu.Reason.JustTesting; } }
IEnumerator ShowLoadingScreen() { // Reset the loading bar Vector2 max = loadingBar.anchorMax; max.x = 0; loadingBar.anchorMax = max; buildState = MalformedGameMenu.Reason.None; // Show the Malformed game menu if there's any problems yield return(StartCoroutine(VerifyBuild())); // Wait until the loading status is finished while (LoadingStatus.IsFinished == false) { // Update the loading bar max.x = LoadingStatus.Ratio; loadingBar.anchorMax = max; // Wait for a frame yield return(null); } // Wait for a frame yield return(null); // Make the loading bar full max.x = 1; loadingBar.anchorMax = max; // Wait for a frame yield return(null); // Get the scene manager to change scenes LoadNextMenu(buildState); }