You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Merge pull request #86676 from rune-scape/sparse-script-reload
GDScript: Hot-reload changed scripts only
This commit is contained in:
@@ -720,11 +720,22 @@ void CSharpLanguage::reload_all_scripts() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void CSharpLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload) {
|
||||
(void)p_script; // UNUSED
|
||||
|
||||
void CSharpLanguage::reload_scripts(const Array &p_scripts, bool p_soft_reload) {
|
||||
CRASH_COND(!Engine::get_singleton()->is_editor_hint());
|
||||
|
||||
bool has_csharp_script = false;
|
||||
for (int i = 0; i < p_scripts.size(); ++i) {
|
||||
Ref<CSharpScript> cs_script = p_scripts[i];
|
||||
if (cs_script.is_valid()) {
|
||||
has_csharp_script = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!has_csharp_script) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
get_godotsharp_editor()->get_node(NodePath("HotReloadAssemblyWatcher"))->call("RestartTimer");
|
||||
#endif
|
||||
@@ -736,6 +747,12 @@ void CSharpLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_soft
|
||||
#endif
|
||||
}
|
||||
|
||||
void CSharpLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload) {
|
||||
Array scripts;
|
||||
scripts.push_back(p_script);
|
||||
reload_scripts(scripts, p_soft_reload);
|
||||
}
|
||||
|
||||
#ifdef GD_MONO_HOT_RELOAD
|
||||
bool CSharpLanguage::is_assembly_reloading_needed() {
|
||||
ERR_FAIL_NULL_V(gdmono, false);
|
||||
|
||||
Reference in New Issue
Block a user