-
-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SceneTree.get_debug_collisions_color is not available in GDExtension
- Loading branch information
Showing
5 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "shape_3d.h" | ||
#include "../../math/color.h" | ||
#include "project_settings.h" | ||
#include "scene_tree.h" | ||
|
||
namespace zylann::godot { | ||
|
||
#ifdef TOOLS_ENABLED | ||
|
||
Color get_shape_3d_default_color(const SceneTree &scene_tree) { | ||
#if defined(ZN_GODOT) | ||
return scene_tree.get_debug_collisions_color(); | ||
|
||
#elif defined(ZN_GODOT_EXTENSION) | ||
// TODO GDX: SceneTree.get_debug_collisions_color is not exposed | ||
return ProjectSettings::get_singleton()->get_setting( | ||
"debug/shapes/collision/shape_color", Color(0.0, 0.6, 0.7, 0.42) | ||
) | ||
#endif | ||
} | ||
|
||
#endif | ||
|
||
} // namespace zylann::godot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters