Advertisement
JonneOpettaja

Game

Feb 3rd, 2019
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Game : MonoBehaviour {
  6.  
  7.     private int score;
  8.  
  9.     void Start () {
  10.         score = 0;
  11.     }
  12.  
  13.     private void TargetHit()
  14.     {
  15.         score = score + 100;
  16.         Debug.Log("Score: " + score);  //näyttää pisteet konsolissa
  17.     }
  18.  
  19.     private void OnGUI()
  20.     {
  21.         GUI.skin.label.fontSize = 30;
  22.         GUI.Label (new Rect (20,20,200,50), "Score: " + score);
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement