Description
The DebugOverlay
property of the Component
class provides access to the DebugOverlaySystem
, which allows for the drawing of temporary debug shapes and text within the scene. This can be particularly useful for visualizing data or debugging complex interactions within your game environment.
Usage
To use the DebugOverlay
property, you can access it from any instance of a Component
within your game. This property is not static, so it must be accessed through a specific component instance. Once accessed, you can use the methods provided by the DebugOverlaySystem
to draw shapes, lines, or text for debugging purposes.
Example
// Example of using DebugOverlay to draw a line in the scene
public class MyComponent : Component
{
public override void OnComponentUpdate()
{
// Draw a line from (0, 0, 0) to (10, 10, 10) in red
DebugOverlay.Line(Vector3.Zero, new Vector3(10, 10, 10), Color.Red);
}
}