Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- master.js
- #pragma strict
- //public var text: string;
- var scoreText: GUIText;
- function Start () {
- scoreText.text = "Score/n" + ballpoints.points
- ;
- }
- function Update () {
- }
- --------------------------------
- #pragma strict
- public var points : float = 0;
- function Start () {
- }
- function Update () {
- }
- function OnCollisionEnter (other : Collision) {
- if (other.gameObject.name == "collider_30"){
- Debug.Log("30 points");
- points+=30;
- Destroy (gameObject);
- }
- if (other.gameObject.name == "collider_20"){
- Debug.Log("20 points");
- points+=20;
- //Object.Destroy;
- Destroy (gameObject);
- }
- if (other.gameObject.name == "collider_10"){
- Debug.Log("10 points");
- points+=10;
- //Object.Destroy;
- Destroy (gameObject);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement