mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-19 05:48:07 -04:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using System.Diagnostics;
|
|
|
|
namespace Editor;
|
|
|
|
public static class DebuggingMenus
|
|
{
|
|
[Menu( "Editor", "Debug/Show Physics Debug", "grid_3x3" )]
|
|
public static bool ShowPhysicsDebug
|
|
{
|
|
get => ConsoleSystem.GetValueInt( "physics_debug_draw" ) == 1;
|
|
set => ConsoleSystem.SetValue( "physics_debug_draw", value ? "1" : "0" );
|
|
}
|
|
|
|
[Menu( "Editor", "Debug/Show Interpolation Debug", "fiber_smart_record" )]
|
|
public static bool ShowInterpolationDebug
|
|
{
|
|
get => ConsoleSystem.GetValueInt( "debug_interp" ) == 1;
|
|
set => ConsoleSystem.SetValue( "debug_interp", value ? "1" : "0" );
|
|
}
|
|
|
|
[Menu( "Editor", "Debug/Show Hitbox Debug", "ads_click" )]
|
|
public static bool ShowHitboxDebug
|
|
{
|
|
get => ConsoleSystem.GetValueInt( "debug_hitbox" ) == 1;
|
|
set => ConsoleSystem.SetValue( "debug_hitbox", value ? "1" : "0" );
|
|
}
|
|
|
|
[Menu( "Editor", "Debug/Visualize Scene Objects", "grid_3x3" )]
|
|
public static bool VisualizeSceneObjects
|
|
{
|
|
get => ConsoleSystem.GetValueInt( "sc_visualize_sceneobjects" ) == 1;
|
|
set => ConsoleSystem.SetValue( "sc_visualize_sceneobjects", value ? "1" : "0" );
|
|
}
|
|
|
|
[Menu( "Editor", "Debug/Full Garbage Collection" )]
|
|
public static void FullCollection()
|
|
{
|
|
var sw = Stopwatch.StartNew();
|
|
GC.Collect();
|
|
Log.Info( $"Collection took {sw.Elapsed.TotalMilliseconds:0.00}ms" );
|
|
}
|
|
}
|