1
0
mirror of https://github.com/boudji-ludwig-pett/cnam-geometry-dash.git synced 2025-04-10 21:47:07 +02:00

29 lines
692 B
C#

using System;
using UnityEngine;
using UnityEngine.UI;
public class LevelTotalAttempts : MonoBehaviour
{
public Text levelTotalAttemptsText;
public LevelsLoader levelsLoader;
private string GetText()
{
int number = levelsLoader.levelCurrent.TotalAttempts;
FormattableString message = $"{number:N0}";
return "Total Attempts: " + FormattableString.Invariant(message);
}
public void Start()
{
levelsLoader = GameObject.FindGameObjectWithTag("LevelsLoader").GetComponent<LevelsLoader>();
levelTotalAttemptsText.text = GetText();
}
public void Update()
{
levelTotalAttemptsText.text = GetText();
}
}