Browse Source

Allow Editor to reload external changes of scripts

Nông Văn Tình 1 năm trước cách đây
mục cha
commit
c051c44df9
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      editor/editor_node.cpp

+ 5 - 1
editor/editor_node.cpp

@@ -872,7 +872,11 @@ void EditorNode::_resources_changed(const Vector<String> &p_resources) {
 		}
 
 		if (!res->editor_can_reload_from_file()) {
-			continue;
+			Ref<Script> scr = res;
+			// Scripts are reloaded via the script editor.
+			if (scr.is_null() || ScriptEditor::get_singleton()->get_open_scripts().has(scr)) {
+				continue;
+			}
 		}
 		if (!res->get_path().is_resource_file() && !res->get_path().is_absolute_path()) {
 			continue;