mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
KcpTransport: OnGUIStatistics helper function for easier OnGUI overwrites
This commit is contained in:
parent
7b1d6fd412
commit
582a02eec8
@ -277,12 +277,8 @@ public static string PrettyBytes(long bytes)
|
||||
return $"{(bytes / (1024f * 1024f * 1024f)):F2} GB";
|
||||
}
|
||||
|
||||
// OnGUI allocates even if it does nothing. avoid in release.
|
||||
#if UNITY_EDITOR || DEVELOPMENT_BUILD
|
||||
protected virtual void OnGUI()
|
||||
protected virtual void OnGUIStatistics()
|
||||
{
|
||||
if (!statisticsGUI) return;
|
||||
|
||||
GUILayout.BeginArea(new Rect(5, 110, 300, 300));
|
||||
|
||||
if (ServerActive())
|
||||
@ -314,6 +310,13 @@ protected virtual void OnGUI()
|
||||
|
||||
GUILayout.EndArea();
|
||||
}
|
||||
|
||||
// OnGUI allocates even if it does nothing. avoid in release.
|
||||
#if UNITY_EDITOR || DEVELOPMENT_BUILD
|
||||
protected virtual void OnGUI()
|
||||
{
|
||||
if (statisticsGUI) OnGUIStatistics();
|
||||
}
|
||||
#endif
|
||||
|
||||
protected virtual void OnLogStatistics()
|
||||
|
Loading…
Reference in New Issue
Block a user