This commit is contained in:
2022-06-25 15:42:49 +02:00
commit 1080b53db3
235 changed files with 25161 additions and 0 deletions

44
Assets/Scripts/HuDcko.cs Normal file
View File

@@ -0,0 +1,44 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using System.Text;
public class HuDcko : MonoBehaviour
{
public int collectedcubes = 0;
public int collectedcubes_max = 0;
public bool ontop = false;
public string text = "";
public bool won = false;
public TextMeshProUGUI textmeshpro;
// Start is called before the first frame update
void Start()
{
textmeshpro = GetComponent<TextMeshProUGUI>();
}
// Update is called once per frame
void Update()
{
//prepare stringbuilder for textmeshpro
StringBuilder sb = new StringBuilder();
sb.Append("Collected cubes: ");
sb.Append(collectedcubes);
sb.Append("/");
sb.Append(collectedcubes_max);
sb.Append("\n");
sb.Append("On top: ");
sb.Append(ontop);
sb.Append("\n");
string hax = sb.ToString();
if (won)
{
textmeshpro.text = "You won!";
}
else
{
textmeshpro.text = hax;
}
}
}