Class SimProfilerMarkers

Namespace
TDMaker.Unity.View
Assembly
TDMaker.Unity.dll

Core profiling hook that wraps every fixed step and every pipeline stage (system) in a Unity Unity.Profiling.ProfilerMarker, so the Unity Profiler shows TDMaker.Sim.Step with one child marker per stage (TDMaker.Sim.Motion, TDMaker.Sim.Ranged, ...). Another ISimProfiler can be chained through Next; it receives every callback after the marker begins and before it ends.

public sealed class SimProfilerMarkers : ISimProfiler
Inheritance
SimProfilerMarkers
Implements
Inherited Members

Remarks

Installed by SimulationRunner in builds with the profiler enabled (editor and development players). Marker Begin/End compile away in non-development players. Allocates only the first time a new system index is seen. Built-in stages are named after SimStage; registered custom systems are named TDMaker.Sim.<anchor stage>#<pipeline index>.

Constructors

SimProfilerMarkers()

public SimProfilerMarkers()

Fields

StepMarkerName

Marker name of a whole fixed step.

public const string StepMarkerName = "TDMaker.Sim.Step"

Field Value

string

Properties

Next

Optional profiler that also receives every callback (for example a timer of your own).

public ISimProfiler Next { get; set; }

Property Value

ISimProfiler

Methods

StageName(SimStage, int)

The display name used for a pipeline entry: the stage name for built-in systems, Stage#index otherwise.

public static string StageName(SimStage stage, int systemIndex)

Parameters

stage SimStage
systemIndex int

Returns

string

SystemFinished(Simulation, SimStage, int)

Ends one pipeline entry.

public void SystemFinished(Simulation simulation, SimStage stage, int systemIndex)

Parameters

simulation Simulation
stage SimStage
systemIndex int

SystemStarted(Simulation, SimStage, int)

Begins a pipeline entry. Custom systems retain their registered anchor stage; systemIndex distinguishes entries.

public void SystemStarted(Simulation simulation, SimStage stage, int systemIndex)

Parameters

simulation Simulation
stage SimStage
systemIndex int

TickFinished(Simulation)

Ends a step, including an exceptional or terminal command-only step.

public void TickFinished(Simulation simulation)

Parameters

simulation Simulation

TickStarted(Simulation)

Begins a fixed step, before input injection and previous-position snapshots.

public void TickStarted(Simulation simulation)

Parameters

simulation Simulation