@@ -52,6 +52,7 @@ void CalcStatistics(float[] data, int count, out float mean, out float variance,
5252 }
5353
5454 static Color [ ] colors = new Color [ ] { Color . red , Color . green } ;
55+ float [ ] fpsHistory = new float [ 50 ] ;
5556 public void TickUpdate ( )
5657 {
5758 if ( m_ShowStats < 1 )
@@ -63,14 +64,17 @@ public void TickUpdate()
6364
6465 DebugOverlay . SetColor ( Color . yellow ) ;
6566 DebugOverlay . SetOrigin ( 0 , 0 ) ;
66- DebugOverlay . Write ( 0 , 0 , "FPS: {0,7:###.##}" , 1.0f / Time . deltaTime ) ;
67+
68+ DebugOverlay . Write ( 1 , 0 , "FPS:{0,6:###.##}" , 1.0f / Time . deltaTime ) ;
69+ fpsHistory [ Time . frameCount % fpsHistory . Length ] = 1.0f / Time . deltaTime ;
70+ DebugOverlay . DrawGraph ( 1 , 1 , 9 , 1.5f , fpsHistory , Time . frameCount % fpsHistory . Length , Color . green ) ;
6771
6872 if ( m_ShowStats < 2 )
6973 return ;
7074
71- DebugOverlay . Write ( 0 , 1 , "Hello, {0,-5} world!" , Time . frameCount % 100 < 50 ? "Happy" : "Evil" ) ;
72- DebugOverlay . Write ( 0 , 2 , "FrameNo: {0,7}" , Time . frameCount ) ;
73- DebugOverlay . Write ( 0 , 3 , "MonoHeap:{0,7} kb" , ( int ) ( UnityEngine . Profiling . Profiler . GetMonoUsedSizeLong ( ) / 1024 ) ) ;
75+ DebugOverlay . Write ( 0 , 4 , "Hello, {0,-5} world!" , Time . frameCount % 100 < 50 ? "Happy" : "Evil" ) ;
76+ DebugOverlay . Write ( 0 , 5 , "FrameNo: {0,7}" , Time . frameCount ) ;
77+ DebugOverlay . Write ( 0 , 6 , "MonoHeap:{0,7} kb" , ( int ) ( UnityEngine . Profiling . Profiler . GetMonoUsedSizeLong ( ) / 1024 ) ) ;
7478
7579 /// Graphing difference between deltaTime and actual passed time
7680 float fps = Time . deltaTime * 1000.0f ;
0 commit comments