// Show this HUD layer public void show() { string stageTextAddition = string.Empty; stageTextAddition = StageSystemManager.isOnFinalStage() == true ? " (final)" : string.Empty; stageText.text = "Stage " + StageSystemManager.getCurrentStage().ToString() + stageTextAddition; animComp.SetBool("isShowing", true); animComp.SetBool("isHiding", false); }
// Show this layer public void show() { Cursor.visible = true; toolTipText.text = string.Empty; animComp.SetBool("isShowing", true); // Add on click listener quitButton.onClick.AddListener(delegate { musicPlayer.fadeOut(); StartCoroutine(transitionToMainMenu()); }); winsText.text = PlayerStatsContainer.getWins().ToString() + " / " + StageSystemManager.getFinalStage().ToString(); rankText.text = StageSystemManager.getPlayerRank(PlayerStatsContainer.getWins()); }
// When this HUD layer is shown public void show() { Cursor.visible = true; tooltipText.text = string.Empty; continueButton.onClick.AddListener(delegate { // If the player is not on the last stage // Increase the stage count if (StageSystemManager.isOnFinalStage() == false) { StageSystemManager.setCurrentStage(StageSystemManager.getCurrentStage() + 1); } musicPlayer.fadeOut(); StartCoroutine(reloadLevel()); }); quitButton.onClick.AddListener(delegate { musicPlayer.fadeOut(); StartCoroutine(goToMainMenu()); }); // Set the content of the title based on whether the player // reached the score target if (player.getBounceCount() >= ScoreTargetController.getScoreTarget()) { titleText.text = "You Win"; } else { titleText.text = "You Lose"; } scoreGoalText.text = ScoreTargetController.getScoreTarget().ToString(); playerBounceResultText.text = player.getBounceCount().ToString(); animComp.SetBool("isShowing", true); animComp.SetBool("isHiding", false); }
// End the game public static IEnumerator endGame() { player.disable(); hudLayerController.hideGameplayHUDLayer(); yield return(new WaitForSeconds(2.0f)); // If the player is on the final stage // Show the stage run end HUD layer if (StageSystemManager.isOnFinalStage() == true) { hudLayerController.showStageRunEndHUDLayer(); } // Otherwise // Show the game over HUD layer else { hudLayerController.showGameOverHUDLayer(); } }
// Start the game private IEnumerator startGame() { float startDelay = 2.5f; welcomeScreen_hide(); currentScreenIndicator.gameObject.SetActive(false); loadingText.gameObject.SetActive(true); background.enabled = false; StageSystemManager.resetValues(); ScoreTargetController.resetValues(); PlayerStatsContainer.resetValues(); yield return(new WaitForSeconds(1.0f)); fadeImageAnimator.SetBool("isShowing", true); yield return(new WaitForSeconds(startDelay)); SceneManager.LoadSceneAsync("Scene_GameArea_Sanctuary"); }
// Start the game private IEnumerator startGame() { float delay = 2.0f; hide(); PlayerStatsContainer.resetValues(); StageSystemManager.resetValues(); ScoreTargetController.resetValues(); Cursor.visible = false; loadingText.gameObject.SetActive(true); yield return(new WaitForSeconds(delay)); fadeImage.SetBool("isShowing", true); yield return(new WaitForSeconds(2.5f)); SceneManager.LoadSceneAsync("Scene_GameArea_Sanctuary"); }