Ejemplo n.º 1
0
        private void StopProfilers(string name, CustomProfilerStep step)
        {
#if UNITY_EDITOR
            StopProfiler(name);
#endif
            StopProfiler(step);
        }
Ejemplo n.º 2
0
        private void ExecuteSubSystems(Stage stage, string stageName, CustomProfilerStep step)
        {
            try
            {
                StartProfilers(stageName, step);

                _stage = stage;

                var vehicleEntityList = _vehicleSelector.ActiveVehicles;
                int vehicleCount      = vehicleEntityList.Count;
                for (int i = 0; i < vehicleCount; ++i)
                {
                    var entity = vehicleEntityList[i];
                    _currentEntity = entity;

                    ExecuteVehicleSystems();
                }
            }
            catch (Exception e)
            {
                _logger.ErrorFormat("Exception {0}", e);
            }
            finally
            {
                StopProfilers(stageName, step);
            }
        }
Ejemplo n.º 3
0
 public void ProfileStart(CustomProfilerStep step)
 {
     if (Enabled)
     {
         var info = _current.Get(step);
         Start(info);
     }
 }
Ejemplo n.º 4
0
 public float ProfileEnd(CustomProfilerStep step)
 {
     if (Enabled)
     {
         var info = _current.Get(step);
         return(End(info));
     }
     return(0.0f);
 }
Ejemplo n.º 5
0
 private float StopProfiler(CustomProfilerStep step)
 {
     if (!_lastStep)
     {
         SingletonManager.Get <DurationHelp>().ProfilePause(step);
         return(0.0f);
     }
     else
     {
         return(SingletonManager.Get <DurationHelp>().ProfileEnd(step));
     }
 }
Ejemplo n.º 6
0
        public void ProfilePause(CustomProfilerStep step)
        {
            if (Enabled)
            {
                var info = _current.Get(step);

                if (Debug)
                {
                    _logger.InfoFormat("Pause Profiler {0}", info.Name);
                    var name = _profilerStack.Pop();
                    if (!info.Name.Equals(name, System.StringComparison.Ordinal))
                    {
                        _logger.ErrorFormat("Pause Mismatch Profiler {0}-{1}", name, info.Name);
                    }
                }

                info.PauseProfile();
            }
        }
Ejemplo n.º 7
0
 public CustomProfileInfo GetProfileInfo(CustomProfilerStep step)
 {
     return(_current.Get(step));
 }
Ejemplo n.º 8
0
        public void ProfileAddInfo(CustomProfilerStep step, string addInfo)
        {
            var info = _current.Get(step);

            info.AddInfo = addInfo;
        }
Ejemplo n.º 9
0
        public void ProfileAddExecuteCount(CustomProfilerStep step, int execCount)
        {
            var info = _current.Get(step);

            info.ExecCount += execCount;
        }
Ejemplo n.º 10
0
 public CustomProfileInfo Get(CustomProfilerStep step)
 {
     return(_profileInfos[(int)step]);
 }
Ejemplo n.º 11
0
 private void StartProfiler(CustomProfilerStep step)
 {
     SingletonManager.Get <DurationHelp>().ProfileStart(step);
 }
Ejemplo n.º 12
0
        private void ExecuteCmdsInSubSystems(Stage stage, int startTime, int endTime, string stageName, CustomProfilerStep step)
        {
            try
            {
                StartProfilers(stageName, step);

                _stage = stage;
                if (_isServer && !_serverAuthorative)
                {
                    ExecuteLatestCmdsInSubSystems();
                }
                else
                {
                    ExecuteCmdsInSubSystemsBetween(startTime, endTime);
                }
            }
            catch (Exception e)

            {
                _logger.ErrorFormat("Exception {0}", e);
            }
            finally
            {
                StopProfilers(stageName, step);
            }
        }
Ejemplo n.º 13
0
 private void Simulate(string stageName, CustomProfilerStep step)
 {
     StartProfilers(stageName, step);
     PhysicsUtility.Simulate(_simulationTimer.SimulationStepTime);
     StopProfilers(stageName, step);
 }