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

Method reload

modules/mono/csharp_script.cpp:2596–2629  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2594}
2595
2596Error CSharpScript::reload(bool p_keep_state) {
2597 if (!reload_invalidated) {
2598 return OK;
2599 }
2600
2601 // In the case of C#, reload doesn't really do any script reloading.
2602 // That's done separately via domain reloading.
2603 reload_invalidated = false;
2604
2605 String script_path = get_path();
2606
2607 valid = GDMonoCache::managed_callbacks.ScriptManagerBridge_AddScriptBridge(this, &script_path);
2608
2609 if (valid) {
2610#ifdef DEBUG_ENABLED
2611 print_verbose("Found class for script " + get_path());
2612#endif // DEBUG_ENABLED
2613
2614 update_script_class_info(this);
2615
2616 _update_exports();
2617
2618#ifdef TOOLS_ENABLED
2619 // If the EditorFileSystem singleton is available, update the file;
2620 // otherwise, the file will be updated when the singleton becomes available.
2621 EditorFileSystem *efs = EditorFileSystem::get_singleton();
2622 if (efs) {
2623 efs->update_file(script_path);
2624 }
2625#endif
2626 }
2627
2628 return OK;
2629}
2630
2631ScriptLanguage *CSharpScript::get_language() const {
2632 return CSharpLanguage::get_singleton();

Callers 2

reload_assembliesMethod · 0.45
loadMethod · 0.45

Calls 1

update_fileMethod · 0.80

Tested by

no test coverage detected