void IConsoleWindow.OnGUI() { // 如果游戏模块没有创建 if (MotionEngine.Contains(typeof(GameObjectPoolManager)) == false) { _scrollPos = ConsoleGUI.BeginScrollView(_scrollPos, 30); ConsoleGUI.YellowLable($"{nameof(GameObjectPoolManager)} is not create."); ConsoleGUI.EndScrollView(); return; } var pools = GameObjectPoolManager.Instance.GetAllCollectors; ConsoleGUI.Lable($"池总数:{pools.Count}"); _scrollPos = ConsoleGUI.BeginScrollView(_scrollPos, 30); foreach (var pair in pools) { string content = $"[{pair.Value.Location}] CacheCount = {pair.Value.Count} SpwanCount = {pair.Value.SpawnCount}"; if (pair.Value.States == EAssetStates.Fail) { ConsoleGUI.RedLable(content); } else { ConsoleGUI.Lable(content); } } ConsoleGUI.EndScrollView(); }
void IConsoleWindow.OnGUI() { // 过滤信息 FilterInfos(); GUILayout.BeginHorizontal(); { GUILayout.Label("搜索关键字 : ", ConsoleGUI.LableStyle, GUILayout.Width(140)); _filterKey = GUILayout.TextField(_filterKey, ConsoleGUI.TextFieldStyle, GUILayout.Width(400)); } GUILayout.EndHorizontal(); ConsoleGUI.Lable($"加载器总数:{_loaderTotalCount}"); float offset = ConsoleGUI.ToolbarStyle.fixedHeight + ConsoleGUI.LableStyle.fontSize; _scrollPos = ConsoleGUI.BeginScrollView(_scrollPos, offset); for (int i = 0; i < _cacheInfos.Count; i++) { var element = _cacheInfos[i]; if (element.LoadState == ELoaderStates.Fail || element.ProviderFailedCount > 0) { ConsoleGUI.RedLable(element.Info); } else { ConsoleGUI.Lable(element.Info); } } ConsoleGUI.EndScrollView(); }
void IConsoleWindow.OnGUI() { // 过滤信息 FilterInfos(); GUILayout.BeginHorizontal(); { GUILayout.Label("搜索关键字 : ", ConsoleGUI.LableStyle, GUILayout.Width(200)); _filterKey = GUILayout.TextField(_filterKey, ConsoleGUI.TextFieldStyle, GUILayout.Width(500)); } GUILayout.EndHorizontal(); ConsoleGUI.Lable($"加载器总数:{_loaderTotalCount}"); float offset = ConsoleGUI.ToolbarStyle.fixedHeight + ConsoleGUI.LableStyle.fontSize; _scrollPos = ConsoleGUI.BeginScrollView(_scrollPos, offset); for (int i = 0; i < _cacheInfos.Count; i++) { var loaderWrapper = _cacheInfos[i]; string loaderInfo = $"名称:{loaderWrapper.BundleName} 版本:{loaderWrapper.Loader.BundleInfo.Version} 引用:{loaderWrapper.Loader.RefCount}"; if (loaderWrapper.Loader.States == ELoaderStates.Fail) { ConsoleGUI.RedLable(loaderInfo); } else { ConsoleGUI.Lable(loaderInfo); } var providers = loaderWrapper.Loader.GetProviders(); foreach (var provider in providers) { string providerInfo = $"对象:{provider.AssetName} 引用:{provider.RefCount}"; if (provider.States == EAssetStates.Fail) { ConsoleGUI.RedLable(providerInfo); } else { ConsoleGUI.Lable(providerInfo); } } } ConsoleGUI.EndScrollView(); }
void IConsoleWindow.OnGUI() { var pools = GameObjectPoolManager.Instance.GetAllCollectors; ConsoleGUI.Lable($"池总数:{pools.Count}"); _scrollPos = ConsoleGUI.BeginScrollView(_scrollPos, 30); foreach (var pair in pools) { string content = $"[{pair.Value.Location}] CacheCount = {pair.Value.Count} SpwanCount = {pair.Value.SpawnCount}"; if (pair.Value.States == EAssetStates.Fail) { ConsoleGUI.RedLable(content); } else { ConsoleGUI.Lable(content); } } ConsoleGUI.EndScrollView(); }
void IConsoleWindow.OnGUI() { GUILayout.BeginHorizontal(); _showLog = ConsoleGUI.Toggle($"Log ({_logCount})", _showLog); _showWarning = ConsoleGUI.Toggle($"Warning ({_warningCount})", _showWarning); _showError = ConsoleGUI.Toggle($"Error ({_errorCount})", _showError); GUILayout.EndHorizontal(); float offset = ConsoleGUI.ToolbarStyle.fixedHeight; _scrollPos = ConsoleGUI.BeginScrollView(_scrollPos, offset); for (int i = 0; i < _logs.Count; i++) { LogWrapper wrapper = _logs[i]; if (wrapper.Type == LogType.Log) { if (_showLog) { ConsoleGUI.Lable(wrapper.Log); } } else if (wrapper.Type == LogType.Warning) { if (_showWarning) { ConsoleGUI.YellowLable(wrapper.Log); } } else if (wrapper.Type == LogType.Assert || wrapper.Type == LogType.Error || wrapper.Type == LogType.Exception) { if (_showError) { ConsoleGUI.RedLable(wrapper.Log); } } } ConsoleGUI.EndScrollView(); }
void IConsoleWindow.OnGUI() { GUILayout.BeginHorizontal(); _showLog = ConsoleGUI.Toggle("Log", _showLog); _showWarning = ConsoleGUI.Toggle("Warning", _showWarning); _showError = ConsoleGUI.Toggle("Error", _showError); GUILayout.EndHorizontal(); _scrollPos = ConsoleGUI.BeginScrollView(_scrollPos, 40); for (int i = 0; i < _logs.Count; i++) { LogWrapper wrapper = _logs[i]; if (wrapper.Type == LogType.Log) { if (_showLog) { ConsoleGUI.Lable(wrapper.Log); } } else if (wrapper.Type == LogType.Warning) { if (_showWarning) { ConsoleGUI.YellowLable(wrapper.Log); } } else { if (_showError) { ConsoleGUI.RedLable(wrapper.Log); } } } ConsoleGUI.EndScrollView(); }
void IConsoleWindow.OnGUI() { GUILayout.BeginHorizontal(); if (GUILayout.Button("Clear", ConsoleGUI.ButtonStyle, GUILayout.Width(100))) { _totalCount = 0; _logCount = 0; _warningCount = 0; _errorCount = 0; _logs.Clear(); } _showLog = ConsoleGUI.Toggle($"Log ({_logCount})", _showLog); _showWarning = ConsoleGUI.Toggle($"Warning ({_warningCount})", _showWarning); _showError = ConsoleGUI.Toggle($"Error ({_errorCount})", _showError); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("搜索关键字 : ", ConsoleGUI.LableStyle, GUILayout.Width(200)); _filterKey = GUILayout.TextField(_filterKey, ConsoleGUI.TextFieldStyle, GUILayout.Width(500)); } GUILayout.EndHorizontal(); float offset = ConsoleGUI.ToolbarStyle.fixedHeight * 3; _scrollPos = ConsoleGUI.BeginScrollView(_scrollPos, offset); for (int i = 0; i < _logs.Count; i++) { LogWrapper wrapper = _logs[i]; // 只搜索关键字 if (string.IsNullOrEmpty(_filterKey) == false) { if (wrapper.Log.Contains(_filterKey) == false) { continue; } } if (wrapper.Type == LogType.Log) { if (_showLog) { ConsoleGUI.Lable(wrapper.Log); } } else if (wrapper.Type == LogType.Warning) { if (_showWarning) { ConsoleGUI.YellowLable(wrapper.Log); } } else if (wrapper.Type == LogType.Assert || wrapper.Type == LogType.Error || wrapper.Type == LogType.Exception) { if (_showError) { ConsoleGUI.RedLable(wrapper.Log); } } } ConsoleGUI.EndScrollView(); }