1 #pragma warning disable 0414 5 namespace HKI.Core.Debuging
17 [SerializeField] KeyCode DebugInfoAndConsoleToggleKey = KeyCode.F1;
18 [SerializeField] KeyCode FPSInfoToggleKey = KeyCode.F2;
19 [Range(0.1f, 1f)] [SerializeField]
float UpdateInterval = 0.2f;
27 [SerializeField] GameObject DebugInfoAndConsoleGO = null;
28 [SerializeField] GameObject SimpleFPSInfoGO = null;
31 bool debugInfoAndCosoleVisibility =
true;
33 int simpleFPSInfoIndex = -1;
35 WaitForSecondsRealtime efsr = null;
41 FPSInfo.
Init(FPSCalc);
42 SimpleFPSInfo.
Init(FPSCalc);
43 HideVisibilityDebugInfoAndConsole();
44 NextSimpleFPSInfoMode();
46 efsr =
new WaitForSecondsRealtime(UpdateInterval);
47 StartCoroutine(UpdateCoroutine());
55 if(Input.GetKeyDown(DebugInfoAndConsoleToggleKey))
56 ToggleVisibilityDebugInfoAndConsole();
58 if (Input.GetKeyDown(FPSInfoToggleKey))
59 NextSimpleFPSInfoMode();
71 while(Application.isPlaying)
81 if (DebugInfoAndConsoleGO.activeSelf)
83 if(SystemInfo != null)
86 if(MemoryInfo != null)
93 if(SimpleFPSInfo != null && SimpleFPSInfoGO.activeSelf)
100 if(debugInfoAndCosoleVisibility)
101 HideVisibilityDebugInfoAndConsole();
103 ShowVisibilityDebugInfoAndConsole();
108 DebugInfoAndConsoleGO.SetActive(
true);
110 debugInfoAndCosoleVisibility =
true;
115 DebugInfoAndConsoleGO.SetActive(
false);
117 debugInfoAndCosoleVisibility =
false;
122 simpleFPSInfoIndex = (simpleFPSInfoIndex + 1) % 3;
124 switch(simpleFPSInfoIndex)
127 SimpleFPSInfoGO.SetActive(
false);
131 SimpleFPSInfoGO.SetActive(
true);
136 SimpleFPSInfoGO.SetActive(
true);
void HideVisibilityDebugInfoAndConsole()
void Init(FPSCalc fpsCalc)
This MonoBehaviour updates the UI of the FPS only information with the FPS information calced by FPSC...
This class calcs the fps and greates the graph.
This MonoBehaviour fetches and updates the UI of the DebugSystem/Console with the system information...
void OnButtonClicker_ResetMinAndMaxFPS()
void Init(FPSCalc fpsCalc)
void ToggleVisibilityDebugInfoAndConsole()
This MonoBehaviour updates the UI of the DebugSystem/Console with the FPS information calced by FPSCa...
void UpdateInfo(FPSCalc fpsCalc)
IEnumerator UpdateCoroutine()
MonoBehaviour for the debugging console
This MonoBehaviour fetches the memory info from Unity and updates the UI with this information...
void ShowVisibilityDebugInfoAndConsole()
void NextSimpleFPSInfoMode()
The DebugSystem controlls the pannel which includes the DebuConsole, SystemInfo, MemoryInfo and FPSIn...
void UpdateInfo(FPSCalc fpsCalc)