feat: stats display (#45)

This commit is contained in:
2025-03-17 11:49:34 +01:00
committed by GitHub
parent 28e56eeab7
commit a9bd2a0048
8 changed files with 526 additions and 464 deletions

View File

@ -0,0 +1,25 @@
using UnityEngine;
using UnityEngine.UI;
public class LevelProgression : MonoBehaviour
{
public Text levelProgressionText;
public LevelsLoader levelsLoader;
private string GetText()
{
return "Progression: ";
}
public void Start()
{
levelsLoader = GameObject.FindGameObjectWithTag("LevelsLoader").GetComponent<LevelsLoader>();
levelProgressionText.text = GetText();
}
public void Update()
{
levelProgressionText.text = GetText();
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f53ed5a09d2704999b0f112382f62309

View File

@ -0,0 +1,28 @@
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();
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: c2e1b06afdba22e2e801e20c56a99a30

View File

@ -0,0 +1,28 @@
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();
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 90096cf0341a3ac178de4db506d4205c