// Awake private void Awake() { if (Instance != null) { Destroy(this.gameObject); return; } Instance = this; // add the texts into the list to keep track foreach (Transform item in nameContainer.transform) { nameTexts.Add(item.GetComponent <TextMeshProUGUI>()); } foreach (Transform item in scoreContainer.transform) { scoreTexts.Add(item.GetComponent <TextMeshProUGUI>()); } maxCount = nameTexts.Count; // Check if we need to use the Single or Multiplayer Background Image // if (fileManager.plyrCount == 2) if (!IsSinglePlayer()) { background.sprite = multi; } else { background.sprite = single; } // Disable Buttons clearButton.SetActive(false); continueButton.SetActive(false); }
void OnSceneLoaded(Scene scene, LoadSceneMode loadMode) { if (scene.name != "SaveTest") { return; } // Input new Score ScoreBoardUI scoreBoard = GameObject.FindGameObjectWithTag("GameController").GetComponent <ScoreBoardUI>(); scoreBoard.RetrieveExistingData(); scoreBoard.InputNewScore(score); // Clear the Score ClearScore(); }