示例#1
0
        public void StopStopwatch(PerformanceStopwatchType type)
        {
            if (!GameConfig.ShowPerformanceInfo || !_stopWatches.ContainsKey(type))
            {
                return;
            }

            _stopWatches[type].Stop();
        }
示例#2
0
        private Color PerformanceStopwatchTypeToColor(PerformanceStopwatchType type)
        {
            switch (type)
            {
            case PerformanceStopwatchType.GlobalUpdate:
                return(Color.Red);

            case PerformanceStopwatchType.GlobalDraw:
                return(Color.Green);

            case PerformanceStopwatchType.BossBulletUpdate:
                return(Color.Orange);

            case PerformanceStopwatchType.GlobalCollisionUpdate:
                return(Color.Yellow);

            case PerformanceStopwatchType.PlayerBulletsBossHitboxesCollisionUpdate:
                return(Color.Pink);

            default:
                return(Color.White);
            }
        }
示例#3
0
        public void StartStopwatch(PerformanceStopwatchType type)
        {
            if (!GameConfig.ShowPerformanceInfo)
            {
                return;
            }

            if (_stopWatches.ContainsKey(type))
            {
                _stopWatches[type].Reset();
            }
            else
            {
                if (GameConfig.DisabledGraph.Contains(type))
                {
                    return;
                }

                _stopWatches.Add(type, new Stopwatch());
                _performanceData.Add(type, new Queue <float>(_maxPerformanceSample));
            }

            _stopWatches[type].Start();
        }