Advertisement
aandnota

ScoreKeeper

Jan 10th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private var scorekeeper : ScoreKeeper;
  2. private var textMesh : TextMesh;
  3. var score = 0;
  4.  
  5. function Start () {
  6.     scorekeeper = GameObject.FindObjectOfType(ScoreKeeper);
  7. }
  8.  
  9. function Awake () {
  10.     textMesh = GetComponent(TextMesh);
  11. }
  12.  
  13. function AddToScore(){
  14.     ++score;
  15.     textMesh.text = "" + score;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement