/// 1.6.0 /// //////////////////////////////////////////////// /// THIS FILE HAS BEEN GENERATED. /// THE CHANGES IN THIS FILE WILL BE OVERWRITTEN /// AFTER THE UPDATE OR AFTER THE RESTART! /// //////////////////////////////////////////////// using Godot; using System; using System.Linq; static internal class DebugDraw2D { private static GodotObject _instance; public static GodotObject Instance { get { if (!GodotObject.IsInstanceValid(_instance)) { _instance = Engine.GetSingleton("DebugDraw2D"); } return _instance; } } private static readonly StringName __clear_all = "clear_all"; private static readonly StringName __begin_text_group = "begin_text_group"; private static readonly StringName __end_text_group = "end_text_group"; private static readonly StringName __set_text = "set_text"; private static readonly StringName __clear_texts = "clear_texts"; private static readonly StringName __get_render_stats = "get_render_stats"; public static void ClearAll() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__clear_all); #endif } } public static void BeginTextGroup(string group_title, int group_priority = 0, Color? group_color = null, bool show_title = true, int title_size = -1, int text_size = -1) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__begin_text_group, group_title, group_priority, group_color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_0, show_title, title_size, text_size); #endif } } public static void EndTextGroup() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__end_text_group); #endif } } public static void SetText(string key, Variant? value = null, int priority = 0, Color? color_of_value = null, float duration = -1.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__set_text, key, value ?? _DebugDrawUtils_.DefaultArgumentsData.arg_1, priority, color_of_value ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void ClearTexts() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__clear_texts); #endif } } public static DebugDraw2DStats GetRenderStats() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw2DStats)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__get_render_stats)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } private static readonly StringName __prop_empty_color = "empty_color"; private static readonly StringName __prop_debug_enabled = "debug_enabled"; private static readonly StringName __prop_config = "config"; private static readonly StringName __prop_custom_canvas = "custom_canvas"; public static Color EmptyColor { get => (Color)ClassDB.ClassGetProperty(Instance, __prop_empty_color); set => ClassDB.ClassSetProperty(Instance, __prop_empty_color, value); } public static bool DebugEnabled { get => (bool)ClassDB.ClassGetProperty(Instance, __prop_debug_enabled); set => ClassDB.ClassSetProperty(Instance, __prop_debug_enabled, value); } public static DebugDraw2DConfig Config { get => (DebugDraw2DConfig)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)ClassDB.ClassGetProperty(Instance, __prop_config)); set => ClassDB.ClassSetProperty(Instance, __prop_config, value.Instance); } public static Control CustomCanvas { get => (Control)ClassDB.ClassGetProperty(Instance, __prop_custom_canvas); set => ClassDB.ClassSetProperty(Instance, __prop_custom_canvas, value); } } internal class DebugDraw2DStats : _DebugDrawInstanceWrapper_ { public DebugDraw2DStats(GodotObject _instance) : base (_instance) {} public DebugDraw2DStats() : this((GodotObject)ClassDB.Instantiate("DebugDraw2DStats")) { } private static readonly StringName __prop_overlay_text_groups = "overlay_text_groups"; private static readonly StringName __prop_overlay_text_lines = "overlay_text_lines"; public int OverlayTextGroups { get => (int)ClassDB.ClassGetProperty(Instance, __prop_overlay_text_groups); set => ClassDB.ClassSetProperty(Instance, __prop_overlay_text_groups, value); } public int OverlayTextLines { get => (int)ClassDB.ClassGetProperty(Instance, __prop_overlay_text_lines); set => ClassDB.ClassSetProperty(Instance, __prop_overlay_text_lines, value); } } internal class DebugDraw2DConfig : _DebugDrawInstanceWrapper_ { public DebugDraw2DConfig(GodotObject _instance) : base (_instance) {} public DebugDraw2DConfig() : this((GodotObject)ClassDB.Instantiate("DebugDraw2DConfig")) { } public enum BlockPosition : long { LeftTop = 0, RightTop = 1, LeftBottom = 2, RightBottom = 3, } private static readonly StringName __prop_text_block_position = "text_block_position"; private static readonly StringName __prop_text_block_offset = "text_block_offset"; private static readonly StringName __prop_text_padding = "text_padding"; private static readonly StringName __prop_text_default_duration = "text_default_duration"; private static readonly StringName __prop_text_default_size = "text_default_size"; private static readonly StringName __prop_text_foreground_color = "text_foreground_color"; private static readonly StringName __prop_text_background_color = "text_background_color"; private static readonly StringName __prop_text_custom_font = "text_custom_font"; public DebugDraw2DConfig.BlockPosition TextBlockPosition { get => (DebugDraw2DConfig.BlockPosition)(long)ClassDB.ClassGetProperty(Instance, __prop_text_block_position); set => ClassDB.ClassSetProperty(Instance, __prop_text_block_position, (long)value); } public Vector2I TextBlockOffset { get => (Vector2I)ClassDB.ClassGetProperty(Instance, __prop_text_block_offset); set => ClassDB.ClassSetProperty(Instance, __prop_text_block_offset, value); } public Vector2I TextPadding { get => (Vector2I)ClassDB.ClassGetProperty(Instance, __prop_text_padding); set => ClassDB.ClassSetProperty(Instance, __prop_text_padding, value); } public float TextDefaultDuration { get => (float)ClassDB.ClassGetProperty(Instance, __prop_text_default_duration); set => ClassDB.ClassSetProperty(Instance, __prop_text_default_duration, value); } public int TextDefaultSize { get => (int)ClassDB.ClassGetProperty(Instance, __prop_text_default_size); set => ClassDB.ClassSetProperty(Instance, __prop_text_default_size, value); } public Color TextForegroundColor { get => (Color)ClassDB.ClassGetProperty(Instance, __prop_text_foreground_color); set => ClassDB.ClassSetProperty(Instance, __prop_text_foreground_color, value); } public Color TextBackgroundColor { get => (Color)ClassDB.ClassGetProperty(Instance, __prop_text_background_color); set => ClassDB.ClassSetProperty(Instance, __prop_text_background_color, value); } public Font TextCustomFont { get => (Font)ClassDB.ClassGetProperty(Instance, __prop_text_custom_font); set => ClassDB.ClassSetProperty(Instance, __prop_text_custom_font, value); } } static internal class DebugDraw3D { private static GodotObject _instance; public static GodotObject Instance { get { if (!GodotObject.IsInstanceValid(_instance)) { _instance = Engine.GetSingleton("DebugDraw3D"); } return _instance; } } public enum PointType : long { TypeSquare = 0, TypeSphere = 1, } private static readonly StringName __regenerate_geometry_meshes = "regenerate_geometry_meshes"; private static readonly StringName __clear_all = "clear_all"; private static readonly StringName __draw_sphere = "draw_sphere"; private static readonly StringName __draw_sphere_xf = "draw_sphere_xf"; private static readonly StringName __draw_cylinder = "draw_cylinder"; private static readonly StringName __draw_cylinder_ab = "draw_cylinder_ab"; private static readonly StringName __draw_box = "draw_box"; private static readonly StringName __draw_box_ab = "draw_box_ab"; private static readonly StringName __draw_box_xf = "draw_box_xf"; private static readonly StringName __draw_aabb = "draw_aabb"; private static readonly StringName __draw_aabb_ab = "draw_aabb_ab"; private static readonly StringName __draw_line_hit = "draw_line_hit"; private static readonly StringName __draw_line_hit_offset = "draw_line_hit_offset"; private static readonly StringName __draw_line = "draw_line"; private static readonly StringName __draw_lines = "draw_lines"; private static readonly StringName __draw_ray = "draw_ray"; private static readonly StringName __draw_line_path = "draw_line_path"; private static readonly StringName __draw_arrowhead = "draw_arrowhead"; private static readonly StringName __draw_arrow = "draw_arrow"; private static readonly StringName __draw_arrow_ray = "draw_arrow_ray"; private static readonly StringName __draw_arrow_path = "draw_arrow_path"; private static readonly StringName __draw_point_path = "draw_point_path"; private static readonly StringName __draw_square = "draw_square"; private static readonly StringName __draw_plane = "draw_plane"; private static readonly StringName __draw_points = "draw_points"; private static readonly StringName __draw_camera_frustum = "draw_camera_frustum"; private static readonly StringName __draw_camera_frustum_planes = "draw_camera_frustum_planes"; private static readonly StringName __draw_position = "draw_position"; private static readonly StringName __draw_gizmo = "draw_gizmo"; private static readonly StringName __draw_grid = "draw_grid"; private static readonly StringName __draw_grid_xf = "draw_grid_xf"; private static readonly StringName __draw_text = "draw_text"; private static readonly StringName __get_render_stats = "get_render_stats"; private static readonly StringName __get_render_stats_for_world = "get_render_stats_for_world"; private static readonly StringName __new_scoped_config = "new_scoped_config"; private static readonly StringName __scoped_config = "scoped_config"; public static void RegenerateGeometryMeshes() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__regenerate_geometry_meshes); #endif } } public static void ClearAll() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__clear_all); #endif } } public static void DrawSphere(Vector3 position, float radius = 0.5f, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_sphere, position, radius, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawSphereXf(Transform3D transform, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_sphere_xf, transform, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawCylinder(Transform3D transform, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_cylinder, transform, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawCylinderAb(Vector3 a, Vector3 b, float radius = 0.5f, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_cylinder_ab, a, b, radius, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawBox(Vector3 position, Quaternion rotation, Vector3 size, Color? color = null, bool is_box_centered = false, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_box, position, rotation, size, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, is_box_centered, duration); #endif } } public static void DrawBoxAb(Vector3 a, Vector3 b, Vector3? up = null, Color? color = null, bool is_ab_diagonal = true, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_box_ab, a, b, up ?? _DebugDrawUtils_.DefaultArgumentsData.arg_3, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, is_ab_diagonal, duration); #endif } } public static void DrawBoxXf(Transform3D transform, Color? color = null, bool is_box_centered = true, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_box_xf, transform, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, is_box_centered, duration); #endif } } public static void DrawAabb(Aabb aabb, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_aabb, aabb, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawAabbAb(Vector3 a, Vector3 b, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_aabb_ab, a, b, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawLineHit(Vector3 start, Vector3 end, Vector3 hit, bool is_hit, float hit_size = 0.25f, Color? hit_color = null, Color? after_hit_color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_line_hit, start, end, hit, is_hit, hit_size, hit_color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, after_hit_color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawLineHitOffset(Vector3 start, Vector3 end, bool is_hit, float unit_offset_of_hit = 0.5f, float hit_size = 0.25f, Color? hit_color = null, Color? after_hit_color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_line_hit_offset, start, end, is_hit, unit_offset_of_hit, hit_size, hit_color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, after_hit_color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawLine(Vector3 a, Vector3 b, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_line, a, b, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawLines(Vector3[] lines, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_lines, lines, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawRay(Vector3 origin, Vector3 direction, float length, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_ray, origin, direction, length, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawLinePath(Vector3[] path, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_line_path, path, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawArrowhead(Transform3D transform, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_arrowhead, transform, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawArrow(Vector3 a, Vector3 b, Color? color = null, float arrow_size = 0.5f, bool is_absolute_size = false, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_arrow, a, b, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, arrow_size, is_absolute_size, duration); #endif } } public static void DrawArrowRay(Vector3 origin, Vector3 direction, float length, Color? color = null, float arrow_size = 0.5f, bool is_absolute_size = false, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_arrow_ray, origin, direction, length, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, arrow_size, is_absolute_size, duration); #endif } } public static void DrawArrowPath(Vector3[] path, Color? color = null, float arrow_size = 0.75f, bool is_absolute_size = true, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_arrow_path, path, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, arrow_size, is_absolute_size, duration); #endif } } public static void DrawPointPath(Vector3[] path, DebugDraw3D.PointType type = (DebugDraw3D.PointType)0, float size = 0.25f, Color? points_color = null, Color? lines_color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_point_path, path, (long)type, size, points_color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, lines_color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawSquare(Vector3 position, float size = 0.20000000298023f, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_square, position, size, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawPlane(Plane plane, Color? color = null, Vector3? anchor_point = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_plane, plane, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, anchor_point ?? _DebugDrawUtils_.DefaultArgumentsData.arg_4, duration); #endif } } public static void DrawPoints(Vector3[] points, DebugDraw3D.PointType type = (DebugDraw3D.PointType)0, float size = 0.20000000298023f, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_points, points, (long)type, size, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawCameraFrustum(Camera3D camera, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_camera_frustum, camera, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawCameraFrustumPlanes(Godot.Collections.Array camera_frustum, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_camera_frustum_planes, camera_frustum, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawPosition(Transform3D transform, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_position, transform, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static void DrawGizmo(Transform3D transform, Color? color = null, bool is_centered = false, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_gizmo, transform, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, is_centered, duration); #endif } } public static void DrawGrid(Vector3 origin, Vector3 x_size, Vector3 y_size, Vector2I subdivision, Color? color = null, bool is_centered = true, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_grid, origin, x_size, y_size, subdivision, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, is_centered, duration); #endif } } public static void DrawGridXf(Transform3D transform, Vector2I subdivision, Color? color = null, bool is_centered = true, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_grid_xf, transform, subdivision, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, is_centered, duration); #endif } } public static void DrawText(Vector3 position, string text, int size = 32, Color? color = null, float duration = 0.0f) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__draw_text, position, text, size, color ?? _DebugDrawUtils_.DefaultArgumentsData.arg_2, duration); #endif } } public static DebugDraw3DStats GetRenderStats() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw3DStats)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__get_render_stats)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public static DebugDraw3DStats GetRenderStatsForWorld(Viewport viewport) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw3DStats)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__get_render_stats_for_world, viewport)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public static DebugDraw3DScopeConfig NewScopedConfig() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw3DScopeConfig)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__new_scoped_config)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public static DebugDraw3DScopeConfig ScopedConfig() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw3DScopeConfig)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__scoped_config)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } private static readonly StringName __prop_empty_color = "empty_color"; private static readonly StringName __prop_debug_enabled = "debug_enabled"; private static readonly StringName __prop_config = "config"; public static Color EmptyColor { get => (Color)ClassDB.ClassGetProperty(Instance, __prop_empty_color); set => ClassDB.ClassSetProperty(Instance, __prop_empty_color, value); } public static bool DebugEnabled { get => (bool)ClassDB.ClassGetProperty(Instance, __prop_debug_enabled); set => ClassDB.ClassSetProperty(Instance, __prop_debug_enabled, value); } public static DebugDraw3DConfig Config { get => (DebugDraw3DConfig)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)ClassDB.ClassGetProperty(Instance, __prop_config)); set => ClassDB.ClassSetProperty(Instance, __prop_config, value.Instance); } } internal class DebugDraw3DStats : _DebugDrawInstanceWrapper_ { public DebugDraw3DStats(GodotObject _instance) : base (_instance) {} public DebugDraw3DStats() : this((GodotObject)ClassDB.Instantiate("DebugDraw3DStats")) { } private static readonly StringName __prop_instances = "instances"; private static readonly StringName __prop_lines = "lines"; private static readonly StringName __prop_instances_physics = "instances_physics"; private static readonly StringName __prop_lines_physics = "lines_physics"; private static readonly StringName __prop_total_geometry = "total_geometry"; private static readonly StringName __prop_visible_instances = "visible_instances"; private static readonly StringName __prop_visible_lines = "visible_lines"; private static readonly StringName __prop_total_visible = "total_visible"; private static readonly StringName __prop_time_filling_buffers_instances_usec = "time_filling_buffers_instances_usec"; private static readonly StringName __prop_time_filling_buffers_lines_usec = "time_filling_buffers_lines_usec"; private static readonly StringName __prop_time_filling_buffers_instances_physics_usec = "time_filling_buffers_instances_physics_usec"; private static readonly StringName __prop_time_filling_buffers_lines_physics_usec = "time_filling_buffers_lines_physics_usec"; private static readonly StringName __prop_total_time_filling_buffers_usec = "total_time_filling_buffers_usec"; private static readonly StringName __prop_time_culling_instances_usec = "time_culling_instances_usec"; private static readonly StringName __prop_time_culling_lines_usec = "time_culling_lines_usec"; private static readonly StringName __prop_total_time_culling_usec = "total_time_culling_usec"; private static readonly StringName __prop_total_time_spent_usec = "total_time_spent_usec"; private static readonly StringName __prop_created_scoped_configs = "created_scoped_configs"; private static readonly StringName __prop_orphan_scoped_configs = "orphan_scoped_configs"; private static readonly StringName __prop_nodes_label3d_visible = "nodes_label3d_visible"; private static readonly StringName __prop_nodes_label3d_visible_physics = "nodes_label3d_visible_physics"; private static readonly StringName __prop_nodes_label3d_exists = "nodes_label3d_exists"; private static readonly StringName __prop_nodes_label3d_exists_physics = "nodes_label3d_exists_physics"; private static readonly StringName __prop_nodes_label3d_exists_total = "nodes_label3d_exists_total"; public int Instances { get => (int)ClassDB.ClassGetProperty(Instance, __prop_instances); set => ClassDB.ClassSetProperty(Instance, __prop_instances, value); } public int Lines { get => (int)ClassDB.ClassGetProperty(Instance, __prop_lines); set => ClassDB.ClassSetProperty(Instance, __prop_lines, value); } public int InstancesPhysics { get => (int)ClassDB.ClassGetProperty(Instance, __prop_instances_physics); set => ClassDB.ClassSetProperty(Instance, __prop_instances_physics, value); } public int LinesPhysics { get => (int)ClassDB.ClassGetProperty(Instance, __prop_lines_physics); set => ClassDB.ClassSetProperty(Instance, __prop_lines_physics, value); } public int TotalGeometry { get => (int)ClassDB.ClassGetProperty(Instance, __prop_total_geometry); set => ClassDB.ClassSetProperty(Instance, __prop_total_geometry, value); } public int VisibleInstances { get => (int)ClassDB.ClassGetProperty(Instance, __prop_visible_instances); set => ClassDB.ClassSetProperty(Instance, __prop_visible_instances, value); } public int VisibleLines { get => (int)ClassDB.ClassGetProperty(Instance, __prop_visible_lines); set => ClassDB.ClassSetProperty(Instance, __prop_visible_lines, value); } public int TotalVisible { get => (int)ClassDB.ClassGetProperty(Instance, __prop_total_visible); set => ClassDB.ClassSetProperty(Instance, __prop_total_visible, value); } public int TimeFillingBuffersInstancesUsec { get => (int)ClassDB.ClassGetProperty(Instance, __prop_time_filling_buffers_instances_usec); set => ClassDB.ClassSetProperty(Instance, __prop_time_filling_buffers_instances_usec, value); } public int TimeFillingBuffersLinesUsec { get => (int)ClassDB.ClassGetProperty(Instance, __prop_time_filling_buffers_lines_usec); set => ClassDB.ClassSetProperty(Instance, __prop_time_filling_buffers_lines_usec, value); } public int TimeFillingBuffersInstancesPhysicsUsec { get => (int)ClassDB.ClassGetProperty(Instance, __prop_time_filling_buffers_instances_physics_usec); set => ClassDB.ClassSetProperty(Instance, __prop_time_filling_buffers_instances_physics_usec, value); } public int TimeFillingBuffersLinesPhysicsUsec { get => (int)ClassDB.ClassGetProperty(Instance, __prop_time_filling_buffers_lines_physics_usec); set => ClassDB.ClassSetProperty(Instance, __prop_time_filling_buffers_lines_physics_usec, value); } public int TotalTimeFillingBuffersUsec { get => (int)ClassDB.ClassGetProperty(Instance, __prop_total_time_filling_buffers_usec); set => ClassDB.ClassSetProperty(Instance, __prop_total_time_filling_buffers_usec, value); } public int TimeCullingInstancesUsec { get => (int)ClassDB.ClassGetProperty(Instance, __prop_time_culling_instances_usec); set => ClassDB.ClassSetProperty(Instance, __prop_time_culling_instances_usec, value); } public int TimeCullingLinesUsec { get => (int)ClassDB.ClassGetProperty(Instance, __prop_time_culling_lines_usec); set => ClassDB.ClassSetProperty(Instance, __prop_time_culling_lines_usec, value); } public int TotalTimeCullingUsec { get => (int)ClassDB.ClassGetProperty(Instance, __prop_total_time_culling_usec); set => ClassDB.ClassSetProperty(Instance, __prop_total_time_culling_usec, value); } public int TotalTimeSpentUsec { get => (int)ClassDB.ClassGetProperty(Instance, __prop_total_time_spent_usec); set => ClassDB.ClassSetProperty(Instance, __prop_total_time_spent_usec, value); } public int CreatedScopedConfigs { get => (int)ClassDB.ClassGetProperty(Instance, __prop_created_scoped_configs); set => ClassDB.ClassSetProperty(Instance, __prop_created_scoped_configs, value); } public int OrphanScopedConfigs { get => (int)ClassDB.ClassGetProperty(Instance, __prop_orphan_scoped_configs); set => ClassDB.ClassSetProperty(Instance, __prop_orphan_scoped_configs, value); } public int NodesLabel3dVisible { get => (int)ClassDB.ClassGetProperty(Instance, __prop_nodes_label3d_visible); set => ClassDB.ClassSetProperty(Instance, __prop_nodes_label3d_visible, value); } public int NodesLabel3dVisiblePhysics { get => (int)ClassDB.ClassGetProperty(Instance, __prop_nodes_label3d_visible_physics); set => ClassDB.ClassSetProperty(Instance, __prop_nodes_label3d_visible_physics, value); } public int NodesLabel3dExists { get => (int)ClassDB.ClassGetProperty(Instance, __prop_nodes_label3d_exists); set => ClassDB.ClassSetProperty(Instance, __prop_nodes_label3d_exists, value); } public int NodesLabel3dExistsPhysics { get => (int)ClassDB.ClassGetProperty(Instance, __prop_nodes_label3d_exists_physics); set => ClassDB.ClassSetProperty(Instance, __prop_nodes_label3d_exists_physics, value); } public int NodesLabel3dExistsTotal { get => (int)ClassDB.ClassGetProperty(Instance, __prop_nodes_label3d_exists_total); set => ClassDB.ClassSetProperty(Instance, __prop_nodes_label3d_exists_total, value); } } internal class DebugDraw3DConfig : _DebugDrawInstanceWrapper_ { public DebugDraw3DConfig(GodotObject _instance) : base (_instance) {} public DebugDraw3DConfig() : this((GodotObject)ClassDB.Instantiate("DebugDraw3DConfig")) { } public enum CullingMode : long { Disabled = 0, Rough = 1, Precise = 2, } private static readonly StringName __prop_freeze_3d_render = "freeze_3d_render"; private static readonly StringName __prop_visible_instance_bounds = "visible_instance_bounds"; private static readonly StringName __prop_use_frustum_culling = "use_frustum_culling"; private static readonly StringName __prop_frustum_culling_mode = "frustum_culling_mode"; private static readonly StringName __prop_frustum_length_scale = "frustum_length_scale"; private static readonly StringName __prop_force_use_camera_from_scene = "force_use_camera_from_scene"; private static readonly StringName __prop_geometry_render_layers = "geometry_render_layers"; private static readonly StringName __prop_line_hit_color = "line_hit_color"; private static readonly StringName __prop_line_after_hit_color = "line_after_hit_color"; public bool Freeze3dRender { get => (bool)ClassDB.ClassGetProperty(Instance, __prop_freeze_3d_render); set => ClassDB.ClassSetProperty(Instance, __prop_freeze_3d_render, value); } public bool VisibleInstanceBounds { get => (bool)ClassDB.ClassGetProperty(Instance, __prop_visible_instance_bounds); set => ClassDB.ClassSetProperty(Instance, __prop_visible_instance_bounds, value); } public bool UseFrustumCulling { get => (bool)ClassDB.ClassGetProperty(Instance, __prop_use_frustum_culling); set => ClassDB.ClassSetProperty(Instance, __prop_use_frustum_culling, value); } public DebugDraw3DConfig.CullingMode FrustumCullingMode { get => (DebugDraw3DConfig.CullingMode)(long)ClassDB.ClassGetProperty(Instance, __prop_frustum_culling_mode); set => ClassDB.ClassSetProperty(Instance, __prop_frustum_culling_mode, (long)value); } public float FrustumLengthScale { get => (float)ClassDB.ClassGetProperty(Instance, __prop_frustum_length_scale); set => ClassDB.ClassSetProperty(Instance, __prop_frustum_length_scale, value); } public bool ForceUseCameraFromScene { get => (bool)ClassDB.ClassGetProperty(Instance, __prop_force_use_camera_from_scene); set => ClassDB.ClassSetProperty(Instance, __prop_force_use_camera_from_scene, value); } public int GeometryRenderLayers { get => (int)ClassDB.ClassGetProperty(Instance, __prop_geometry_render_layers); set => ClassDB.ClassSetProperty(Instance, __prop_geometry_render_layers, value); } public Color LineHitColor { get => (Color)ClassDB.ClassGetProperty(Instance, __prop_line_hit_color); set => ClassDB.ClassSetProperty(Instance, __prop_line_hit_color, value); } public Color LineAfterHitColor { get => (Color)ClassDB.ClassGetProperty(Instance, __prop_line_after_hit_color); set => ClassDB.ClassSetProperty(Instance, __prop_line_after_hit_color, value); } } internal class DebugDraw3DScopeConfig : _DebugDrawInstanceWrapper_, IDisposable { public DebugDraw3DScopeConfig(GodotObject _instance) : base (_instance) {} public DebugDraw3DScopeConfig() : this((GodotObject)ClassDB.Instantiate("DebugDraw3DScopeConfig")) { } private static readonly StringName __set_thickness = "set_thickness"; private static readonly StringName __get_thickness = "get_thickness"; private static readonly StringName __set_center_brightness = "set_center_brightness"; private static readonly StringName __get_center_brightness = "get_center_brightness"; private static readonly StringName __set_hd_sphere = "set_hd_sphere"; private static readonly StringName __is_hd_sphere = "is_hd_sphere"; private static readonly StringName __set_plane_size = "set_plane_size"; private static readonly StringName __get_plane_size = "get_plane_size"; private static readonly StringName __set_transform = "set_transform"; private static readonly StringName __get_transform = "get_transform"; private static readonly StringName __set_viewport = "set_viewport"; private static readonly StringName __get_viewport = "get_viewport"; private static readonly StringName __set_no_depth_test = "set_no_depth_test"; private static readonly StringName __is_no_depth_test = "is_no_depth_test"; private static readonly StringName __set_text_outline_color = "set_text_outline_color"; private static readonly StringName __get_text_outline_color = "get_text_outline_color"; private static readonly StringName __set_text_outline_size = "set_text_outline_size"; private static readonly StringName __get_text_outline_size = "get_text_outline_size"; private static readonly StringName __set_text_font = "set_text_font"; private static readonly StringName __get_text_font = "get_text_font"; private static readonly StringName __set_text_fixed_size = "set_text_fixed_size"; private static readonly StringName __get_text_fixed_size = "get_text_fixed_size"; // Additional custom statics private static readonly StringName ___manual_unregister = "_manual_unregister"; // Custom Disposable public new void Dispose() { Instance?.Call(___manual_unregister); } public DebugDraw3DScopeConfig SetThickness(float value) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw3DScopeConfig)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__set_thickness, value)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public float GetThickness() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (float)(Instance?.Call(__get_thickness)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public DebugDraw3DScopeConfig SetCenterBrightness(float value) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw3DScopeConfig)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__set_center_brightness, value)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public float GetCenterBrightness() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (float)(Instance?.Call(__get_center_brightness)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public DebugDraw3DScopeConfig SetHdSphere(bool value) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw3DScopeConfig)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__set_hd_sphere, value)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public bool IsHdSphere() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (bool)(Instance?.Call(__is_hd_sphere)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public DebugDraw3DScopeConfig SetPlaneSize(float value) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw3DScopeConfig)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__set_plane_size, value)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public float GetPlaneSize() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (float)(Instance?.Call(__get_plane_size)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public DebugDraw3DScopeConfig SetTransform(Transform3D value) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw3DScopeConfig)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__set_transform, value)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public Transform3D GetTransform() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (Transform3D)(Instance?.Call(__get_transform)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public DebugDraw3DScopeConfig SetViewport(Viewport value) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw3DScopeConfig)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__set_viewport, value)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public Viewport GetViewport() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (Viewport)(Instance?.Call(__get_viewport)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public DebugDraw3DScopeConfig SetNoDepthTest(bool value) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw3DScopeConfig)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__set_no_depth_test, value)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public bool IsNoDepthTest() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (bool)(Instance?.Call(__is_no_depth_test)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public DebugDraw3DScopeConfig SetTextOutlineColor(Color value) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw3DScopeConfig)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__set_text_outline_color, value)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public Color GetTextOutlineColor() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (Color)(Instance?.Call(__get_text_outline_color)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public DebugDraw3DScopeConfig SetTextOutlineSize(int value) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw3DScopeConfig)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__set_text_outline_size, value)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public int GetTextOutlineSize() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (int)(Instance?.Call(__get_text_outline_size)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public DebugDraw3DScopeConfig SetTextFont(Font value) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw3DScopeConfig)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__set_text_font, value)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public Font GetTextFont() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (Font)(Instance?.Call(__get_text_font)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public DebugDraw3DScopeConfig SetTextFixedSize(bool value) { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (DebugDraw3DScopeConfig)_DebugDrawUtils_.CreateWrapperFromObject((GodotObject)Instance?.Call(__set_text_fixed_size, value)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } public bool GetTextFixedSize() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) return (bool)(Instance?.Call(__get_text_fixed_size)); #endif } #if !DEBUG && !FORCED_DD3D else #endif { #if !DEBUG && !FORCED_DD3D return default; #endif } } } static internal class DebugDrawManager { private static GodotObject _instance; public static GodotObject Instance { get { if (!GodotObject.IsInstanceValid(_instance)) { _instance = Engine.GetSingleton("DebugDrawManager"); } return _instance; } } private static readonly StringName __clear_all = "clear_all"; public static void ClearAll() { #if !DEBUG && !FORCED_DD3D if (_DebugDrawUtils_.IsCallEnabled) #endif { #if (!DEBUG || FORCED_DD3D) || (DEBUG && !FORCED_DD3D) Instance?.Call(__clear_all); #endif } } private static readonly StringName __prop_debug_enabled = "debug_enabled"; public static bool DebugEnabled { get => (bool)ClassDB.ClassGetProperty(Instance, __prop_debug_enabled); set => ClassDB.ClassSetProperty(Instance, __prop_debug_enabled, value); } } internal class _DebugDrawInstanceWrapper_ : IDisposable { public GodotObject Instance { get; protected set; } public _DebugDrawInstanceWrapper_(GodotObject _instance) { if (_instance == null) throw new ArgumentNullException("_instance"); if (!ClassDB.IsParentClass(_instance.GetClass(), GetType().Name)) throw new ArgumentException("\"_instance\" has the wrong type."); Instance = _instance; } public void Dispose() { Instance?.Dispose(); Instance = null; } public void ClearNativePointer() { Instance = null; } } internal static class _DebugDrawUtils_ { const bool is_debug_enabled = #if DEBUG true; #else false; #endif public static readonly bool IsCallEnabled = is_debug_enabled || OS.HasFeature("forced_dd3d"); public static class DefaultArgumentsData { public static readonly Color arg_0 = new Color(0.95999997854233f, 0.95999997854233f, 0.95999997854233f, 1.0f); public static readonly Variant arg_1 = default; public static readonly Color arg_2 = new Color(0.0f, 0.0f, 0.0f, 0.0f); public static readonly Vector3 arg_3 = new Vector3(0.0f, 1.0f, 0.0f); public static readonly Vector3 arg_4 = new Vector3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity); } static System.Collections.Generic.Dictionary cached_instances = new(); static DateTime previous_clear_time = DateTime.Now; public static object CreateWrapperFromObject(GodotObject _instance) { if (_instance == null) { return null; } ulong id = _instance.GetInstanceId(); if (cached_instances.ContainsKey(id)) { return cached_instances[id]; } if ((DateTime.Now - previous_clear_time).TotalSeconds > 1) { var query = cached_instances.Where((i) => GodotObject.IsInstanceIdValid(i.Key)).ToArray(); foreach (var i in query) { i.Value.ClearNativePointer(); cached_instances.Remove(i.Key); } previous_clear_time = DateTime.Now; } switch(_instance.GetClass()) { case "DebugDraw2DStats": { _DebugDrawInstanceWrapper_ new_instance = new DebugDraw2DStats(_instance); cached_instances[id] = new_instance; return new_instance; } case "DebugDraw2DConfig": { _DebugDrawInstanceWrapper_ new_instance = new DebugDraw2DConfig(_instance); cached_instances[id] = new_instance; return new_instance; } case "DebugDraw3DStats": { _DebugDrawInstanceWrapper_ new_instance = new DebugDraw3DStats(_instance); cached_instances[id] = new_instance; return new_instance; } case "DebugDraw3DConfig": { _DebugDrawInstanceWrapper_ new_instance = new DebugDraw3DConfig(_instance); cached_instances[id] = new_instance; return new_instance; } case "DebugDraw3DScopeConfig": { _DebugDrawInstanceWrapper_ new_instance = new DebugDraw3DScopeConfig(_instance); return new_instance; } } throw new NotImplementedException(); } }