// 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); }
// 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(); } }