浏览代码

Properly reload built-in tool scripts

kobewi 4 年之前
父节点
当前提交
75e8eafa72
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      editor/plugins/script_editor_plugin.cpp

+ 5 - 0
editor/plugins/script_editor_plugin.cpp

@@ -1015,6 +1015,11 @@ void ScriptEditor::_scene_saved_callback(const String &p_path) {
 		if (edited_res->get_path().get_slice("::", 0) == p_path) {
 		if (edited_res->get_path().get_slice("::", 0) == p_path) {
 			se->tag_saved_version();
 			se->tag_saved_version();
 		}
 		}
+
+		Ref<Script> scr = edited_res;
+		if (scr.is_valid() && scr->is_tool()) {
+			scr->reload(true);
+		}
 	}
 	}
 }
 }