Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.UI;
- public class Score : MonoBehaviour
- {
- public Text scoreText;
- public int score = 0;
- public void SetScore(int ammount) {
- score += ammount;
- UpdateScoreText(score);
- }
- public void UpdateScoreText(int _score) {
- scoreText.text = "Score: " + _score.ToString();
- }
- public void Start() {
- UpdateScoreText(score);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement