I’m having issues coding a high score into our game… I can get it to display the text - “High Score” where I need, but I can’t get the SingleHighScoreManager to work with the GUIManager like it’s supposed to… I also need to put this in a completely separate scene which shouldn’t be too hard after I figure out how to display it.
<param name="state">If set to <c>true</c>, sets the game over screen on.</param>
public virtual void SetGameOverScreen(bool state)
{
GameOverScreen.SetActive(state);
Text gameOverScreenTextObject GameOverScreen.transform.Find("GameOverScreenText").GetComponent<Text>();
if (gameOverScreenTextObject != null)
gameOverScreenTextObject.text = "HIGH SCORE :" + Mathf.Round(GameManager.Instance.HighScore);
gameOverScreenTextObject.text = "GAME OVER
YOUR SCORE :" + Mathf.Round(GameManager.Instance.Points);
Obviously the Mathf.Round(GameManager.Instance.HighScore) isn’t what needs to be there (maybe it does and I didn’t build the method correctly). I’ve searched as much as possible to find the correct answer, but I’ve been left in the dark. I don’t know a whole lot of C#, been learning through 3dbuzz how to code but that tutorial was from 3 years ago and only is for console scripts. If you could point me in the correct direction to fix this I would greatly appreciate it.