| 461 | } |
| 462 | |
| 463 | void ScriptEcs::remove_script(const String &p_setting_list_name, const String &p_script_path) { |
| 464 | ERR_FAIL_COND_MSG(EditorNode::get_singleton() == nullptr, "The editor is not defined."); |
| 465 | |
| 466 | if (ProjectSettings::get_singleton()->has_setting(p_setting_list_name) == false) { |
| 467 | // Nothing to do. |
| 468 | return; |
| 469 | } |
| 470 | |
| 471 | Array scripts = ProjectSettings::get_singleton()->get_setting(p_setting_list_name); |
| 472 | const int index = scripts.find(p_script_path); |
| 473 | |
| 474 | if (index >= 0) { |
| 475 | scripts.remove_at(index); |
| 476 | ProjectSettings::get_singleton()->set_setting(p_setting_list_name, scripts); |
| 477 | ProjectSettings::get_singleton()->save(); |
| 478 | } |
| 479 | } |