// Start is called before the first frame update void Start() { PlayerData.PlayerStats playerStats = PersistenceController.playerData.playerStats; for (int i = 0; i < playerStats.topScoresAmmount; i++) { GameObject score = (GameObject)Instantiate(highScorePrefab, Vector2.zero, Quaternion.identity, contentParent); score.GetComponent <Text>().text = $"{i + 1} - {playerStats.topScores[i]}"; } }
// Use this for initialization void Start() { PlayerData.PlayerStats playerStats = PersistenceController.playerData.playerStats; //Refatoracao: Mudando strings para interpolação // Set the statistics values in the statistics canvas GameObject.Find("TextDistance").GetComponent <Text>().text = $"LONGEST DISTANCE: {playerStats.topScores[0]}"; GameObject.Find("TextStreak").GetComponent <Text>().text = $"LONGEST STREAK: {playerStats.longestStreak}"; GameObject.Find("TextTokens").GetComponent <Text>().text = $"TOTAL FEATHERS: {playerStats.feathersCollected}"; GameObject.Find("TextPowerups").GetComponent <Text>().text = $"TOTAL POWERUPS: {playerStats.powerupsCollected}"; //GameObject.Find("TextPowerupStreak").GetComponent<Text>().text = $"LONGEST POWERUP: {}"; // ? GameObject.Find("TextCharacters").GetComponent <Text>().text = $"CHARACTERS UNLOCKED: {playerStats.charactersUnlocked}"; }