Score
unknown
plain_text
9 months ago
579 B
7
Indexable
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class PointHandler : MonoBehaviour
{
public int score = 100;
public TextMeshProUGUI scoreText;
public Button showScoreButton;
void Start()
{
// Asegurarse de que el botón tenga el evento asignado
if (showScoreButton != null)
{
showScoreButton.onClick.AddListener(DisplayScore);
}
}
void DisplayScore()
{
if (scoreText != null)
{
scoreText.text = "Score: " + score;
}
}
}
Editor is loading...
Leave a Comment