ScoreManager

PHOTO EMBED

Mon Feb 12 2024 08:41:40 GMT+0000 (Coordinated Universal Time)

Saved by @iliavial #c#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;

public class ScoreManager : MonoBehaviour
{
    public int score;
    public TextMeshProUGUI scoreText;
    void Start()
    {
        UpdateScoreText();
    }
    public void IncreaseScore(int amount)
    {
        score += amount;
        UpdateScoreText();
    }

    void UpdateScoreText()
    {
        scoreText.text = "Score: " + score;
    }
}
content_copyCOPY