Finished tutorial

This commit is contained in:
2026-01-09 10:41:51 +00:00
parent 2a9d124288
commit c8d27ef133
154 changed files with 69096 additions and 4653 deletions

View File

@@ -1,14 +1,29 @@
using UnityEngine;
using TMPro;
public class Scorer : MonoBehaviour
{
[SerializeField] TextMeshProUGUI scoreText;
[SerializeField] int maxHits;
int hits = 0;
void Start()
{
hits = 0;
scoreText.text = "Hits: " + hits.ToString();
}
private void OnCollisionEnter(Collision other)
{
if (other.gameObject.tag != "Hit")
{
if (hits < maxHits)
{
hits++;
Debug.Log("You've bumped into something this many times: " + hits);
scoreText.text = "Hits: " + hits.ToString();
}
else
{
gameObject.SetActive(false);
}
}
}
}