Hey guys, I am new in unity and I just can´t find a solution for my problem. I want to display the high score in my menu Scene (I allready got a text that says Highscore:??Highscore??) by using my uiManager script. Can you help me?
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class uiManager : MonoBehaviour {
public Button[] buttons;
public Text scoreText;
public AudioManager am;
bool gameOver;
int score;
void Start () {
gameOver = false;
score = 0;
InvokeRepeating ("scoreUpdate", 1.0f, 0.5f);
}
void Update () {
scoreText.text = "Score " + score;
}
public void Play(){
SceneManager.LoadScene("Game");
}
void scoreUpdate(){
if (gameOver == false) {
score += 1;
}
}