using UnityEngine; using TMPro; /* -------------------------------------- Project: Programing assessment Standard: 91906 (AS3.7) v.1 School: Tauranga Boys' College Author: Rauputu Noah Phizacklea Date: August 2024 Unity: 2021.3.18f --------------------------------------- */ public class EndScreenManager : MonoBehaviour { public TextMeshProUGUI deathCountText; // Reference to the TextMeshProUGUI for displaying the death count public TextMeshProUGUI coinCountText; // Reference to the text component for displaying coins void Start() { // Retrieve the death count from PlayerPrefs float deathCount = PlayerPrefs.GetFloat("DeathCount", 0); // Update the death count text on the end screen deathCountText.text = "Death Count: " + deathCount.ToString(); // Retrieve the coin count from PlayerPrefs and display it int finalCoinCount = PlayerPrefs.GetInt("CoinCount", 0); coinCountText.text = "Coins Collected: " + finalCoinCount; } }