HKI Core
SimpleFPSInfo.cs
Go to the documentation of this file.
1 using UnityEngine;
2 using UnityEngine.UI;
3 
4 namespace HKI.Core.Debuging
5 {
9  public class SimpleFPSInfo : MonoBehaviour
10  {
11  // Public variables
12  [SerializeField] Text CurrentFPSText = null;
13 
14  [SerializeField] GameObject GraphGO = null;
15  [SerializeField] RawImage GraphImage = null;
16 
17  // Interface functions
18  public void Init(FPSCalc fpsCalc)
19  {
20  GraphImage.texture = fpsCalc.GraphTexture;
21  }
22 
23  public void UpdateInfo(FPSCalc fpsCalc)
24  {
25  if(CurrentFPSText != null)
26  CurrentFPSText.text = fpsCalc.CurrentFPSAndFrameTimeStringSmall;
27  }
28 
29  public void ShowOnlyFPS()
30  {
31  GraphGO.SetActive(false);
32  }
33 
34  public void ShowFPSAndGraph()
35  {
36  GraphGO.SetActive(true);
37  }
38  }
39 }
This MonoBehaviour updates the UI of the FPS only information with the FPS information calced by FPSC...
Definition: SimpleFPSInfo.cs:9
Texture2D GraphTexture
Definition: FPSCalc.cs:80
This class calcs the fps and greates the graph.
Definition: FPSCalc.cs:11
void Init(FPSCalc fpsCalc)
void UpdateInfo(FPSCalc fpsCalc)
string CurrentFPSAndFrameTimeStringSmall
Definition: FPSCalc.cs:83