Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3.  
  4. public class Score : MonoBehaviour
  5. {
  6.     public Text scoreText;
  7.     public int score = 0;
  8.  
  9.     public void SetScore(int ammount) {
  10.         score += ammount;
  11.         UpdateScoreText(score);
  12.     }
  13.  
  14.     public void UpdateScoreText(int _score) {
  15.         scoreText.text = "Score: " + _score.ToString();
  16.     }
  17.  
  18.     public void Start() {
  19.         UpdateScoreText(score);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement