浏览代码

Reload built-in script after create to allow dropping nodes into it

jsjtxietian 2 年之前
父节点
当前提交
d32348c686
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      editor/script_create_dialog.cpp

+ 2 - 0
editor/script_create_dialog.cpp

@@ -390,6 +390,8 @@ void ScriptCreateDialog::_create_new() {
 
 	if (is_built_in) {
 		scr->set_name(internal_name->get_text());
+		// Make sure the script is compiled to make its type recognizable.
+		scr->reload();
 	} else {
 		String lpath = ProjectSettings::get_singleton()->localize_path(file_path->get_text());
 		scr->set_path(lpath);