You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Add "Game" editor for better runtime debugging
This commit is contained in:
@@ -954,11 +954,14 @@ Ref<ArrayMesh> SceneTree::get_debug_contact_mesh() {
|
||||
|
||||
void SceneTree::set_pause(bool p_enabled) {
|
||||
ERR_FAIL_COND_MSG(!Thread::is_main_thread(), "Pause can only be set from the main thread.");
|
||||
ERR_FAIL_COND_MSG(suspended, "Pause state cannot be modified while suspended.");
|
||||
|
||||
if (p_enabled == paused) {
|
||||
return;
|
||||
}
|
||||
|
||||
paused = p_enabled;
|
||||
|
||||
#ifndef _3D_DISABLED
|
||||
PhysicsServer3D::get_singleton()->set_active(!p_enabled);
|
||||
#endif // _3D_DISABLED
|
||||
@@ -972,6 +975,30 @@ bool SceneTree::is_paused() const {
|
||||
return paused;
|
||||
}
|
||||
|
||||
void SceneTree::set_suspend(bool p_enabled) {
|
||||
ERR_FAIL_COND_MSG(!Thread::is_main_thread(), "Suspend can only be set from the main thread.");
|
||||
|
||||
if (p_enabled == suspended) {
|
||||
return;
|
||||
}
|
||||
|
||||
suspended = p_enabled;
|
||||
|
||||
Engine::get_singleton()->set_freeze_time_scale(p_enabled);
|
||||
|
||||
#ifndef _3D_DISABLED
|
||||
PhysicsServer3D::get_singleton()->set_active(!p_enabled && !paused);
|
||||
#endif // _3D_DISABLED
|
||||
PhysicsServer2D::get_singleton()->set_active(!p_enabled && !paused);
|
||||
if (get_root()) {
|
||||
get_root()->_propagate_suspend_notification(p_enabled);
|
||||
}
|
||||
}
|
||||
|
||||
bool SceneTree::is_suspended() const {
|
||||
return suspended;
|
||||
}
|
||||
|
||||
void SceneTree::_process_group(ProcessGroup *p_group, bool p_physics) {
|
||||
// When reading this function, keep in mind that this code must work in a way where
|
||||
// if any node is removed, this needs to continue working.
|
||||
|
||||
Reference in New Issue
Block a user