// Use this for initialization void Start() { guiController = guiObj.GetComponent <GUI_Controller> (); guiController.syncWithRoundManager = true; guiController.hideCanvas(); //GUICONTROLLER addCenterText, setCenterTextInterval, addPowerup, hideCanvas, showCanvas leaderboardManager = leaderboardManagerObj.GetComponent <Leaderboard_Manager> (); playerController = playerObj.GetComponent <Player_Controller_VR> (); this.playerController.setPlayerSpeed(0.0f); this.roundData = this.GetComponent <Round_Data> ().roundData; animalSpawnLocations = GameObject.FindGameObjectsWithTag("Animal Spawn"); powerupSpawnLocations = GameObject.FindGameObjectsWithTag("Powerup Spawn"); alienSpawnLocations = GameObject.FindGameObjectsWithTag("Alien Spawn"); timeStarted = Time.time; timeEnding = timeStarted + timeRoundDuration; StartCoroutine("PowerupSpawnerCoroutine"); //this.startRound (1); }
public IEnumerator StartEndGameLeaderboard(int tempScore) { firebaseController.retrieveLeaderboardOnFirebase(); guicontroller.hideCanvas(); score = tempScore; guicontroller.addCenterText("Score: " + score); //this.hideLeaderboard (); yield return(new WaitForSeconds(4.0f)); SceneManager.LoadScene(SceneManager.GetActiveScene().name); /* * this.showLeaderboard (); * * scoreObj.SetActive (true); * scoreObj.GetComponent<TextMesh> ().text = "Score: " + score; * * if (isFirebase) { * if (isEntryHighScore (tempScore)) { * // Input Name for new highscore * // When Input complete, * // show score * // show main menu button * * nameInputObj.SetActive (true); * leaderboardName.GetComponent<TextMesh> ().text = leaderboardNameString; * * while(!isInputName) * { * yield return new WaitForSeconds(0.5f); * } * * nameInputObj.SetActive (false); * * string leaderboardText = ""; * for (int i = 1; i <= 10; i++) { * leaderboardText += i + ": " + leaderboard [i - 1].name + " | " + leaderboard [i - 1].score + "\n"; * } * * leaderboardTitleObj.SetActive (true); * leaderboardObj.SetActive (true); * leaderboardObj.GetComponent<TextMesh> ().text = leaderboardText; * returnToMainMenuObj.SetActive(true); * } else { * // Show score * // Show highscore list * // Show Main menu button * * string leaderboardText = ""; * * for (int i = 1; i <= 10; i++) { * leaderboardText += i + ": " + leaderboard [i - 1].name + " | " + leaderboard [i - 1].score + "\n"; * } * * leaderboardTitleObj.SetActive (true); * leaderboardObj.SetActive (true); * leaderboardObj.GetComponent<TextMesh> ().text = leaderboardText; * returnToMainMenuObj.SetActive(true); * } * } else { * // Show unable to get high score list * // Prompt return to main menu only * unavailableObj.SetActive(true); * returnToMainMenuObj.SetActive (true); * } * */ }