MCPcopy Create free account
hub / github.com/GodotECS/godex / remove_script

Method remove_script

modules/godot/nodes/script_ecs.cpp:463–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463void 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}

Callers

nothing calls this directly

Calls 1

findMethod · 0.80

Tested by

no test coverage detected