Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class DeltaTimeDebugCS : MonoBehaviour {
- float valFU;
- float valU;
- float valLU;
- float valGU;
- void OnGUI () {
- Time.timeScale=GUI.HorizontalSlider(new Rect(Screen.width/2,10,200,10),Time.timeScale,0,2);
- valGU=Time.deltaTime;
- float curY=10;
- GUI.Label(new Rect(10,curY+=20,300,20),"C#: Time.timeScale="+Time.timeScale);
- GUI.Label(new Rect(10,curY+=20,300,20),"FixedUpdate: "+valFU);
- GUI.Label(new Rect(10,curY+=20,300,20),"Update: "+valU);
- GUI.Label(new Rect(10,curY+=20,300,20),"LateUpdate: "+valLU);
- GUI.Label(new Rect(10,curY+=20,300,20),"OnGUI: "+valGU);
- }
- void FixedUpdate () {
- valFU=Time.deltaTime;
- }
- void Update () {
- valU=Time.deltaTime;
- }
- void LateUpdate () {
- valLU=Time.deltaTime;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement