Advertisement
Guest User

Unity Timer

a guest
May 6th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Timer : MonoBehaviour
  5. {
  6.     float timeRemaining = 0;
  7.     public float TimePlace1;
  8.     public float TimePlace2;
  9.  
  10.  
  11.     void Update ()
  12.     {
  13.         timeRemaining += Time.deltaTime;
  14.     }
  15.     void OnGUI(){
  16.         if (timeRemaining > -1) {
  17.             GUI.Label(new Rect(TimePlace1,TimePlace2,200,200), "Time: "+(int)timeRemaining);
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement