Advertisement
aandnota

BlockDestoryer.js

Jul 9th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var scorekeeper : ScoreKeeper;
  2.  
  3. function Start () {
  4.     scorekeeper = GameObject.FindObjectOfType(ScoreKeeper);
  5. }
  6.  
  7. function OnCollisionEnter(other:Collision){
  8.     if (other.gameObject.tag == "Ball"){
  9.         scorekeeper.AddToScore();
  10.         Destroy(this.gameObject);
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement