Advertisement
Guest User

score

a guest
Oct 31st, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4.  
  5. //namespace CompleteProject
  6. //{
  7. public class ScoreManager : MonoBehaviour
  8. {
  9. public static int score; // The player's score.
  10.  
  11.  
  12. Text text; // Reference to the Text component.
  13.  
  14.  
  15. void Awake ()
  16. {
  17. // Set up the reference.
  18. text = GetComponent <Text> ();
  19.  
  20. // Reset the score.
  21. score = 0;
  22. }
  23.  
  24.  
  25. void Update ()
  26. {
  27. // Set the displayed text to be the word "Score" followed by the score value.
  28. text.text = "" + score;
  29. }
  30. }
  31. //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement