public static void GameViewStatsGUI()
{
GUI.skin = EditorGUIUtility.GetBuiltinSkin(EditorSkin.Scene);
GUI.color = new Color(1f, 1f, 1f, 0.75f);
float width = 300f;
float height = 204f;
int length = Network.connections.Length;
if (length != 0)
{
height += 220f;
}
GUILayout.BeginArea(new Rect((GUIView.current.position.width - width) - 10f, 27f, width, height), "Statistics", GUI.skin.window);
GUILayout.Label("Audio:", sectionHeaderStyle, new GUILayoutOption[0]);
StringBuilder builder = new StringBuilder(400);
float audioLevel = UnityStats.audioLevel;
builder.Append(" Level: " + FormatDb(audioLevel) + (!EditorUtility.audioMasterMute ? "\n" : " (MUTED)\n"));
builder.Append(string.Format(" Clipping: {0:F1}%", 100f * UnityStats.audioClippingAmount));
GUILayout.Label(builder.ToString(), new GUILayoutOption[0]);
GUI.Label(new Rect(170f, 40f, 120f, 20f), string.Format("DSP load: {0:F1}%", 100f * UnityStats.audioDSPLoad));
GUI.Label(new Rect(170f, 53f, 120f, 20f), string.Format("Stream load: {0:F1}%", 100f * UnityStats.audioStreamLoad));
GUILayout.Label("Graphics:", sectionHeaderStyle, new GUILayoutOption[0]);
UpdateFrameTime();
string text = string.Format("{0:F1} FPS ({1:F1}ms)", 1f / Mathf.Max(m_MaxFrameTime, 1E-05f), m_MaxFrameTime * 1000f);
GUI.Label(new Rect(170f, 75f, 120f, 20f), text);
int screenBytes = UnityStats.screenBytes;
int num6 = UnityStats.dynamicBatchedDrawCalls - UnityStats.dynamicBatches;
int num7 = UnityStats.staticBatchedDrawCalls - UnityStats.staticBatches;
int num8 = UnityStats.instancedBatchedDrawCalls - UnityStats.instancedBatches;
StringBuilder builder2 = new StringBuilder(400);
if (m_ClientFrameTime > m_RenderFrameTime)
{
builder2.Append(string.Format(" CPU: main <b>{0:F1}</b>ms render thread {1:F1}ms\n", m_ClientFrameTime * 1000f, m_RenderFrameTime * 1000f));
}
else
{
builder2.Append(string.Format(" CPU: main {0:F1}ms render thread <b>{1:F1}</b>ms\n", m_ClientFrameTime * 1000f, m_RenderFrameTime * 1000f));
}
builder2.Append(string.Format(" Batches: <b>{0}</b> \tSaved by batching: {1}\n", UnityStats.batches, (num6 + num7) + num8));
builder2.Append(string.Format(" Tris: {0} \tVerts: {1} \n", FormatNumber(UnityStats.triangles), FormatNumber(UnityStats.vertices)));
builder2.Append(string.Format(" Screen: {0} - {1}\n", UnityStats.screenRes, EditorUtility.FormatBytes(screenBytes)));
builder2.Append(string.Format(" SetPass calls: {0} \tShadow casters: {1} \n", UnityStats.setPassCalls, UnityStats.shadowCasters));
builder2.Append(string.Format(" Visible skinned meshes: {0} Animations: {1}", UnityStats.visibleSkinnedMeshes, UnityStats.visibleAnimations));
GUILayout.Label(builder2.ToString(), labelStyle, new GUILayoutOption[0]);
if (length != 0)
{
GUILayout.Label("Network:", sectionHeaderStyle, new GUILayoutOption[0]);
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
for (int i = 0; i < length; i++)
{
GUILayout.Label(UnityStats.GetNetworkStats(i), new GUILayoutOption[0]);
}
GUILayout.EndHorizontal();
}
else
{
GUILayout.Label("Network: (no players connected)", sectionHeaderStyle, new GUILayoutOption[0]);
}
GUILayout.EndArea();
}