MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / reload_registered_script

Method reload_registered_script

modules/mono/csharp_script.cpp:2229–2249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2227}
2228
2229void CSharpScript::reload_registered_script(Ref<CSharpScript> p_script) {
2230 // Unlike `reload`, we print an error rather than silently returning,
2231 // as we can assert this won't be called a second time until invalidated.
2232 ERR_FAIL_COND(!p_script->reload_invalidated);
2233
2234 p_script->valid = true;
2235 p_script->reload_invalidated = false;
2236
2237 update_script_class_info(p_script);
2238
2239 p_script->_update_exports();
2240
2241#ifdef TOOLS_ENABLED
2242 // If the EditorFileSystem singleton is available, update the file;
2243 // otherwise, the file will be updated when the singleton becomes available.
2244 EditorFileSystem *efs = EditorFileSystem::get_singleton();
2245 if (efs && !p_script->get_path().is_empty()) {
2246 efs->update_file(p_script->get_path());
2247 }
2248#endif
2249}
2250
2251void CSharpScript::update_script_class_info(Ref<CSharpScript> p_script) {
2252 TypeInfo type_info;

Callers

nothing calls this directly

Calls 4

update_fileMethod · 0.80
_update_exportsMethod · 0.45
is_emptyMethod · 0.45
get_pathMethod · 0.45

Tested by

no test coverage detected