| 1165 | } |
| 1166 | |
| 1167 | void Node::set_physics_process_priority(int p_priority) { |
| 1168 | ERR_THREAD_GUARD |
| 1169 | if (data.physics_process_priority == p_priority) { |
| 1170 | return; |
| 1171 | } |
| 1172 | if (!is_inside_tree()) { |
| 1173 | // Not yet in the tree; trivial update. |
| 1174 | data.physics_process_priority = p_priority; |
| 1175 | return; |
| 1176 | } |
| 1177 | |
| 1178 | if (_is_any_processing()) { |
| 1179 | _remove_from_process_thread_group(); |
| 1180 | } |
| 1181 | |
| 1182 | data.physics_process_priority = p_priority; |
| 1183 | |
| 1184 | if (_is_any_processing()) { |
| 1185 | _add_to_process_thread_group(); |
| 1186 | } |
| 1187 | } |
| 1188 | |
| 1189 | int Node::get_physics_process_priority() const { |
| 1190 | return data.physics_process_priority; |