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:
JesusLuvsYooh 2021-08-11 05:43:31 +01:00 committed by GitHub
parent 9cb4c55276
commit 5c45c5cd75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -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
}
}

View File

@ -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()
{