diff --git a/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs b/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs index a2f5f1b58..f204a8d2c 100644 --- a/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs +++ b/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs @@ -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 // demo. void OnGUI() @@ -132,5 +134,6 @@ void OnGUI() GUILayout.EndHorizontal(); GUILayout.EndArea(); } +#endif } } diff --git a/Assets/Mirror/Runtime/Transport/KCP/MirrorTransport/KcpTransport.cs b/Assets/Mirror/Runtime/Transport/KCP/MirrorTransport/KcpTransport.cs index 354db3569..19e725110 100644 --- a/Assets/Mirror/Runtime/Transport/KCP/MirrorTransport/KcpTransport.cs +++ b/Assets/Mirror/Runtime/Transport/KCP/MirrorTransport/KcpTransport.cs @@ -273,6 +273,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 void OnGUI() { if (!statisticsGUI) return; @@ -308,6 +310,7 @@ void OnGUI() GUILayout.EndArea(); } +#endif void OnLogStatistics() {