mirror of
https://github.com/boudji-ludwig-pett/cnam-geometry-dash.git
synced 2025-04-10 21:47:07 +02:00
29 lines
674 B
C#
29 lines
674 B
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class LevelTotalJumps : MonoBehaviour
|
|
{
|
|
public Text levelTotalJumpsText;
|
|
|
|
public LevelsLoader levelsLoader;
|
|
|
|
private string GetText()
|
|
{
|
|
int number = levelsLoader.levelCurrent.TotalJumps;
|
|
FormattableString message = $"{number:N0}";
|
|
return "Total Jumps: " + FormattableString.Invariant(message);
|
|
}
|
|
|
|
public void Start()
|
|
{
|
|
levelsLoader = GameObject.FindGameObjectWithTag("LevelsLoader").GetComponent<LevelsLoader>();
|
|
levelTotalJumpsText.text = GetText();
|
|
}
|
|
|
|
public void Update()
|
|
{
|
|
levelTotalJumpsText.text = GetText();
|
|
}
|
|
}
|