Advertisement
aandnota

Scorekeeper.js

Jul 9th, 2012
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var textMesh:TextMesh;
  2. var score = 0;
  3. var scorekeeper : ScoreKeeper;
  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