Fix can not set process priority of node if not any process is processing

This commit is contained in:
jsjtxietian 2023-09-26 17:57:45 +08:00
parent 43b9e89a07
commit e36117f557
1 changed files with 10 additions and 2 deletions

View File

@ -968,7 +968,11 @@ void Node::set_process_priority(int p_priority) {
if (_is_any_processing()) { if (_is_any_processing()) {
_remove_from_process_thread_group(); _remove_from_process_thread_group();
data.process_priority = p_priority; }
data.process_priority = p_priority;
if (_is_any_processing()) {
_add_to_process_thread_group(); _add_to_process_thread_group();
} }
} }
@ -990,7 +994,11 @@ void Node::set_physics_process_priority(int p_priority) {
if (_is_any_processing()) { if (_is_any_processing()) {
_remove_from_process_thread_group(); _remove_from_process_thread_group();
data.physics_process_priority = p_priority; }
data.physics_process_priority = p_priority;
if (_is_any_processing()) {
_add_to_process_thread_group(); _add_to_process_thread_group();
} }
} }