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();
        }
예제 #2
0
        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()
        {
            var pools = ReferencePool.GetAllCollectors;

            ConsoleGUI.Lable($"池总数:{pools.Count}");

            _scrollPos = ConsoleGUI.BeginScrollView(_scrollPos, 30);
            foreach (var pair in pools)
            {
                ConsoleGUI.Lable($"[{pair.Value.ClassType.FullName}] CacheCount = {pair.Value.Count} SpwanCount = {pair.Value.SpawnCount}");
            }
            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();
        }
예제 #5
0
        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();
        }
예제 #6
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();
        }
예제 #7
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();
        }
예제 #8
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();
        }
예제 #9
0
        void IConsoleWindow.OnGUI()
        {
            int space = 15;

            _scrollPos = ConsoleGUI.BeginScrollView(_scrollPos);

            // 时间缩放相关
            GUILayout.Space(space);
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Reset", ConsoleGUI.ButtonStyle, GUILayout.Width(100)))
            {
                _timeScaleLevel = 5;
                SetTimeScale(_timeScaleLevel);
            }
            if (GUILayout.Button("+", ConsoleGUI.ButtonStyle, GUILayout.Width(100)))
            {
                _timeScaleLevel++;
                _timeScaleLevel = Mathf.Clamp(_timeScaleLevel, 0, 9);
                SetTimeScale(_timeScaleLevel);
            }
            if (GUILayout.Button("-", ConsoleGUI.ButtonStyle, GUILayout.Width(100)))
            {
                _timeScaleLevel--;
                _timeScaleLevel = Mathf.Clamp(_timeScaleLevel, 0, 9);
                SetTimeScale(_timeScaleLevel);
            }
            GUILayout.EndHorizontal();

            GUILayout.Space(space);
            ConsoleGUI.Lable($"Elapse Time : {GetElapseTime()}");
            ConsoleGUI.Lable($"Time Scale : {Time.timeScale}");

            GUILayout.Space(space);
            ConsoleGUI.Lable($"Unity Version : {Application.unityVersion}");
            ConsoleGUI.Lable($"Unity Pro License : {Application.HasProLicense()}");
            ConsoleGUI.Lable($"Application Version : {Application.version}");
            ConsoleGUI.Lable($"Application Install Path : {Application.dataPath}");
            ConsoleGUI.Lable($"Application Persistent Path : {Application.persistentDataPath}");

            GUILayout.Space(space);
            ConsoleGUI.Lable($"OS : {SystemInfo.operatingSystem}");
            ConsoleGUI.Lable($"OS Memory : {SystemInfo.systemMemorySize / 1024f:f1}GB");
            ConsoleGUI.Lable($"CPU : {SystemInfo.processorType}");
            ConsoleGUI.Lable($"CPU Core : {SystemInfo.processorCount}");

            GUILayout.Space(space);
            ConsoleGUI.Lable($"Device UID : {SystemInfo.deviceUniqueIdentifier}");
            ConsoleGUI.Lable($"Device Model : {SystemInfo.deviceModel}");
            ConsoleGUI.Lable($"Device Name : {SystemInfo.deviceName}");
            ConsoleGUI.Lable($"Device Type : {SystemInfo.deviceType}");

            GUILayout.Space(space);
            ConsoleGUI.Lable($"Graphics Device Name : {SystemInfo.graphicsDeviceName}");
            ConsoleGUI.Lable($"Graphics Device Type : {SystemInfo.graphicsDeviceType}");
            ConsoleGUI.Lable($"Graphics Memory : {SystemInfo.graphicsMemorySize / 1024f:f1}GB");
            ConsoleGUI.Lable($"Graphics Shader Level : {SystemInfo.graphicsShaderLevel}");
            ConsoleGUI.Lable($"Multi-threaded Rendering : {SystemInfo.graphicsMultiThreaded}");
            ConsoleGUI.Lable($"Max Cubemap Size : {SystemInfo.maxCubemapSize}");
            ConsoleGUI.Lable($"Max Texture Size : {SystemInfo.maxTextureSize}");

            GUILayout.Space(space);
            ConsoleGUI.Lable($"Supports Accelerometer : {SystemInfo.supportsAccelerometer}"); //加速计硬件
            ConsoleGUI.Lable($"Supports Gyroscope : {SystemInfo.supportsGyroscope}");         //陀螺仪硬件
            ConsoleGUI.Lable($"Supports Audio : {SystemInfo.supportsAudio}");                 //音频硬件
            ConsoleGUI.Lable($"Supports GPS : {SystemInfo.supportsLocationService}");         //GPS硬件

            GUILayout.Space(space);
            ConsoleGUI.Lable($"Screen DPI : {Screen.dpi}");
            ConsoleGUI.Lable($"Game Resolution : {Screen.width} x {Screen.height}");
            ConsoleGUI.Lable($"Device Resolution : {Screen.currentResolution.width} x {Screen.currentResolution.height}");
            ConsoleGUI.Lable($"Graphics Quality : {QualitySettings.names[QualitySettings.GetQualityLevel()]}");

            GUILayout.Space(space);
            ConsoleGUI.Lable($"Reserved Total Memory : {Profiler.GetTotalReservedMemoryLong() / 1048576}MB");
            ConsoleGUI.Lable($"Allocated Graphics Memory : {Profiler.GetAllocatedMemoryForGraphicsDriver() / 1048576}MB");
            ConsoleGUI.Lable($"Used Memory Pool : {Profiler.GetTotalAllocatedMemoryLong() / 1048576}MB");
            ConsoleGUI.Lable($"Unused Memory Pool : {Profiler.GetTotalUnusedReservedMemoryLong() / 1048576}MB");
            ConsoleGUI.Lable($"Total Mono Memory : {Profiler.GetMonoHeapSizeLong() / 1048576}MB");
            ConsoleGUI.Lable($"Used Mono Memory : {Profiler.GetMonoUsedSizeLong() / 1048576}MB");

            GUILayout.Space(space);
            ConsoleGUI.Lable($"Battery Level : {SystemInfo.batteryLevel}");
            ConsoleGUI.Lable($"Battery Status : {SystemInfo.batteryStatus}");
            ConsoleGUI.Lable($"Network Status : {GetNetworkState()}");

            ConsoleGUI.EndScrollView();
        }
예제 #10
0
        void IConsoleWindow.OnGUI()
        {
            int space = 15;

            _scrollPos = ConsoleGUI.BeginScrollView(_scrollPos, 0);

            GUILayout.Space(space);
            ConsoleGUI.Lable($"Unity Version : {Application.unityVersion}");
            ConsoleGUI.Lable($"Unity Pro License : {Application.HasProLicense()}");
            ConsoleGUI.Lable($"Application Version : {Application.version}");
            ConsoleGUI.Lable($"Application Install Path : {Application.dataPath}");
            ConsoleGUI.Lable($"Application Persistent Path : {Application.persistentDataPath}");

            GUILayout.Space(space);
            ConsoleGUI.Lable($"OS : {SystemInfo.operatingSystem}");
            ConsoleGUI.Lable($"OS Memory : {SystemInfo.systemMemorySize / 1000}GB");
            ConsoleGUI.Lable($"CPU : {SystemInfo.processorType}");
            ConsoleGUI.Lable($"CPU Core : {SystemInfo.processorCount}");

            GUILayout.Space(space);
            ConsoleGUI.Lable($"Device Model : {SystemInfo.deviceModel}");
            ConsoleGUI.Lable($"Device Name : {SystemInfo.deviceName}");
            ConsoleGUI.Lable($"Device Type : {SystemInfo.deviceType}");

            GUILayout.Space(space);
            ConsoleGUI.Lable($"Graphics Device Name : {SystemInfo.graphicsDeviceName}");
            ConsoleGUI.Lable($"Graphics Device Type : {SystemInfo.graphicsDeviceType}");
            ConsoleGUI.Lable($"Graphics Memory : {SystemInfo.graphicsMemorySize / 1000}GB");
            ConsoleGUI.Lable($"Graphics Shader Level : {SystemInfo.graphicsShaderLevel}");
            ConsoleGUI.Lable($"Multi-threaded Rendering : {SystemInfo.graphicsMultiThreaded}");
            ConsoleGUI.Lable($"Max Cubemap Size : {SystemInfo.maxCubemapSize}");
            ConsoleGUI.Lable($"Max Texture Size : {SystemInfo.maxTextureSize}");

            GUILayout.Space(space);
            ConsoleGUI.Lable($"Supports Accelerometer : {SystemInfo.supportsAccelerometer}"); //加速计硬件
            ConsoleGUI.Lable($"Supports Gyroscope : {SystemInfo.supportsGyroscope}");         //陀螺仪硬件
            ConsoleGUI.Lable($"Supports Audio : {SystemInfo.supportsAudio}");                 //音频硬件
            ConsoleGUI.Lable($"Supports GPS : {SystemInfo.supportsLocationService}");         //GPS硬件

            GUILayout.Space(space);
            ConsoleGUI.Lable($"Screen DPI : {Screen.dpi}");
            ConsoleGUI.Lable($"Game Resolution : {Screen.width} x {Screen.height}");
            ConsoleGUI.Lable($"Device Resolution : {Screen.currentResolution.width} x {Screen.currentResolution.height}");
            ConsoleGUI.Lable($"Graphics Quality : {QualitySettings.names[QualitySettings.GetQualityLevel()]}");

            GUILayout.Space(space);
            long memory = Profiler.GetTotalReservedMemoryLong() / 1000000;

            ConsoleGUI.Lable($"Total Memory : {memory}MB");
            memory = Profiler.GetTotalAllocatedMemoryLong() / 1000000;
            ConsoleGUI.Lable($"Used Memory : {memory}MB");
            memory = Profiler.GetTotalUnusedReservedMemoryLong() / 1000000;
            ConsoleGUI.Lable($"Free Memory : {memory}MB");
            memory = Profiler.GetMonoHeapSizeLong() / 1000000;
            ConsoleGUI.Lable($"Total Mono Memory : {memory}MB");
            memory = Profiler.GetMonoUsedSizeLong() / 1000000;
            ConsoleGUI.Lable($"Used Mono Memory : {memory}MB");

            GUILayout.Space(space);
            ConsoleGUI.Lable($"Battery Level : {SystemInfo.batteryLevel}");
            ConsoleGUI.Lable($"Battery Status : {SystemInfo.batteryStatus}");
            ConsoleGUI.Lable($"Network Status : {GetNetworkState()}");
            ConsoleGUI.Lable($"Elapse Time : {GetElapseTime()}");
            ConsoleGUI.Lable($"Time Scale : {Time.timeScale}");

            ConsoleGUI.EndScrollView();
        }