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();
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        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();
        }