Hello. I have a score manager empty in my game & it is used to display the score. I want it so when it hits 1000 Megabytes, it automatically displays 1 Gigabyte instead of Megabytes. Here’s my code.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class ScoreManager : MonoBehaviour
{
public static ScoreManager instance;
[SerializeField] TextMeshProUGUI scoreText;
void Awake() {
instance = this;
}
int score = 0;
// Start is called before the first frame update
void Start()
{
scoreText.text = score.ToString() + " Gigabytes";
}
public void AddPoint() {
score += 1;
scoreText.text = score.ToString() + " Gigabytes";
}
}
Also, how can I persist my manager so it continues to display score & keeps a continous track rather then resetting every level. Many thanks.