This mock-up shows the usage of Custom Profiler
API to create custom profilers in Godot.
- All scripts are inside
res://addons/profiler/
plugin.gd
is mentioned insideplugin.cfg
file.- It sets the GUI scene (
res://addons/profiler/gui_scene.tscn
) used by theprofiler
. - It also adds a custom
Node
namedCustomProfiler
which processes and sends data fromGame
toEditor
. This node should be added to scene tree viaautoload
. profiler.gd
is the script ofCustomProfiler
- It registers
tick
,add
andtoggle
functions toEngineDebugger
under idprofiler
- It registers
capture
function as capture forrotation
(any packet with name matched torotation:*
will be relayed to thecapture
function) - Data is added via
profiler_add_frame_data
in_process
profiler_editor.gd
is attached to the root node of GUI scene (res://addons/profiler/gui_scene.tscn
)- It registers
capture
function to capture packets with names similar torotation:*
rotation:state
is used to activate/deactivate theprofiler
rotation:data
is used to send data fromGame
toEditor