private void OnGUI() { if (Event.current.type == EventType.Repaint) { if (!Camera.main) { GUI.Box(new Rect(-5f, -5f, (float)(Screen.width + 10), (float)(Screen.height + 10)), GUIContent.none); } ManagedLeakDetector.ReadResult readResult = new ManagedLeakDetector.ReadResult(); readResult.Read(); ManagedLeakDetector.Counter[] counterArray = readResult.counters; float single = (float)(Screen.width - 10); this.scroll = GUI.BeginScrollView(new Rect(5f, 5f, single, (float)(Screen.height - 10)), this.scroll, new Rect(0f, 0f, single, (float)((int)counterArray.Length * 20))); int num = 0; ManagedLeakDetector.Counter[] counterArray1 = counterArray; for (int i = 0; i < (int)counterArray1.Length; i++) { ManagedLeakDetector.Counter counter = counterArray1[i]; GUI.Label(new Rect(0f, (float)num, single, 20f), string.Format("{0:000} [{1:0000}] {2}", counter.actualInstanceCount, counter.derivedInstanceCount, counter.type)); num = num + 20; } } }
private void OnGUI() { if (Event.current.type == EventType.Repaint) { if (!Camera.main) { GUI.Box(new Rect(-5f, -5f, (float)(Screen.width + 10), (float)(Screen.height + 10)), GUIContent.none); } ManagedLeakDetector.ReadResult readResult = new ManagedLeakDetector.ReadResult(); readResult.Read(); ManagedLeakDetector.Counter[] counterArray = readResult.counters; float single = (float)(Screen.width - 10); this.scroll = GUI.BeginScrollView(new Rect(5f, 5f, single, (float)(Screen.height - 10)), this.scroll, new Rect(0f, 0f, single, (float)((int)counterArray.Length * 20))); int num = 0; ManagedLeakDetector.Counter[] counterArray1 = counterArray; for (int i = 0; i < (int)counterArray1.Length; i++) { ManagedLeakDetector.Counter counter = counterArray1[i]; GUI.Label(new Rect(0f, (float)num, single, 20f), string.Format("{0:000} [{1:0000}] {2}", counter.actualInstanceCount, counter.derivedInstanceCount, counter.type)); num = num + 20; } } }