void OnGUI() { // Show only enabled and non-hidden systems // Avoid GC Alloc _systems.Clear(); Dictionary <IDebuggable, SystemInfo> .Enumerator iter = _gameSystems.GetEnumerator(); while (iter.MoveNext()) { _systems.Add(iter.Current.Key); } iter.Dispose(); for (int i = 0, cnt = _systems.Count; i < cnt; ++i) { IDebuggable system = _systems[i]; if (IsEnabled(system)) { system.OnDebugGUI(); } } if (_isPanelShowing) { GUI.BringWindowToFront(0); GUI.FocusWindow(0); } }