Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. master.js
  2.  
  3. #pragma strict
  4.  
  5. //public var text: string;
  6. var scoreText: GUIText;
  7.  
  8. function Start () {
  9. scoreText.text = "Score/n" + ballpoints.points
  10. ;
  11. }
  12.  
  13. function Update () {
  14.  
  15. }
  16.  
  17. --------------------------------
  18.  
  19. #pragma strict
  20.  
  21. public var points : float = 0;
  22.  
  23. function Start () {
  24.  
  25. }
  26.  
  27. function Update () {
  28.  
  29. }
  30.  
  31. function OnCollisionEnter (other : Collision) {
  32. if (other.gameObject.name == "collider_30"){
  33. Debug.Log("30 points");
  34. points+=30;
  35. Destroy (gameObject);
  36. }
  37.  
  38. if (other.gameObject.name == "collider_20"){
  39. Debug.Log("20 points");
  40. points+=20;
  41. //Object.Destroy;
  42. Destroy (gameObject);
  43. }
  44.  
  45. if (other.gameObject.name == "collider_10"){
  46. Debug.Log("10 points");
  47. points+=10;
  48. //Object.Destroy;
  49. Destroy (gameObject);
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement