Advertisement
Guest User

Unity test script

a guest
Jun 20th, 2012
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class DeltaTimeDebugCS : MonoBehaviour {
  5.    
  6.     float valFU;
  7.     float valU;
  8.     float valLU;
  9.     float valGU;
  10.    
  11.     void OnGUI () {
  12.         Time.timeScale=GUI.HorizontalSlider(new Rect(Screen.width/2,10,200,10),Time.timeScale,0,2);
  13.        
  14.         valGU=Time.deltaTime;
  15.        
  16.         float curY=10;
  17.         GUI.Label(new Rect(10,curY+=20,300,20),"C#:          Time.timeScale="+Time.timeScale);
  18.         GUI.Label(new Rect(10,curY+=20,300,20),"FixedUpdate: "+valFU);
  19.         GUI.Label(new Rect(10,curY+=20,300,20),"Update:      "+valU);
  20.         GUI.Label(new Rect(10,curY+=20,300,20),"LateUpdate:  "+valLU);
  21.         GUI.Label(new Rect(10,curY+=20,300,20),"OnGUI:      "+valGU);
  22.     }
  23.    
  24.     void FixedUpdate () {
  25.         valFU=Time.deltaTime;
  26.     }
  27.  
  28.     void Update () {
  29.         valU=Time.deltaTime;
  30.     }
  31.  
  32.     void LateUpdate () {
  33.         valLU=Time.deltaTime;
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement