mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Defines for OnGUI (#2875)
* Defines for OnGUI KcpTransport.cs Related to: https://github.com/vis2k/Mirror/pull/2874 "OnGUI allocates even if it does nothing. avoid in release." * Defines for OnGUI SpatialHashing IM.cs Related to: https://github.com/vis2k/Mirror/pull/2874 "OnGUI allocates even if it does nothing. avoid in release." * Update SpatialHashingInterestManagement.cs * Update KcpTransport.cs Co-authored-by: vis2k <info@noobtuts.com>
This commit is contained in:
parent
9cb4c55276
commit
5c45c5cd75
@ -113,6 +113,8 @@ internal void Update()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OnGUI allocates even if it does nothing. avoid in release.
|
||||||
|
#if UNITY_EDITOR || DEVELOPMENT_BUILD
|
||||||
// slider from dotsnet. it's nice to play around with in the benchmark
|
// slider from dotsnet. it's nice to play around with in the benchmark
|
||||||
// demo.
|
// demo.
|
||||||
void OnGUI()
|
void OnGUI()
|
||||||
@ -132,5 +134,6 @@ void OnGUI()
|
|||||||
GUILayout.EndHorizontal();
|
GUILayout.EndHorizontal();
|
||||||
GUILayout.EndArea();
|
GUILayout.EndArea();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -273,6 +273,8 @@ public static string PrettyBytes(long bytes)
|
|||||||
return $"{(bytes / (1024f * 1024f * 1024f)):F2} GB";
|
return $"{(bytes / (1024f * 1024f * 1024f)):F2} GB";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OnGUI allocates even if it does nothing. avoid in release.
|
||||||
|
#if UNITY_EDITOR || DEVELOPMENT_BUILD
|
||||||
void OnGUI()
|
void OnGUI()
|
||||||
{
|
{
|
||||||
if (!statisticsGUI) return;
|
if (!statisticsGUI) return;
|
||||||
@ -308,6 +310,7 @@ void OnGUI()
|
|||||||
|
|
||||||
GUILayout.EndArea();
|
GUILayout.EndArea();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void OnLogStatistics()
|
void OnLogStatistics()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user