Explorar el Código

Add _process(delta) to new script templates. Closes #11994.

mhilbrunner hace 7 años
padre
commit
ba779c1c0c
Se han modificado 2 ficheros con 13 adiciones y 2 borrados
  1. 5 1
      modules/gdscript/gd_editor.cpp
  2. 8 1
      modules/mono/csharp_script.cpp

+ 5 - 1
modules/gdscript/gd_editor.cpp

@@ -61,7 +61,11 @@ Ref<Script> GDScriptLanguage::get_template(const String &p_class_name, const Str
 					   "func _ready():\n" +
 					   "%TS%# Called every time the node is added to the scene.\n" +
 					   "%TS%# Initialization here\n" +
-					   "%TS%pass\n";
+					   "%TS%pass\n\n" +
+					   "#func _process(delta):\n" +
+					   "#%TS%# Called every frame. Delta is time since last frame.\n" +
+					   "#%TS%# Update game logic here.\n" +
+					   "#%TS%pass\n";
 
 	_template = _template.replace("%BASE%", p_base_class_name);
 	_template = _template.replace("%TS%", _get_indentation());

+ 8 - 1
modules/mono/csharp_script.cpp

@@ -277,7 +277,14 @@ Ref<Script> CSharpLanguage::get_template(const String &p_class_name, const Strin
 							 "        // Initialization here\n"
 							 "        \n"
 							 "    }\n"
-							 "}\n";
+							 "\n"
+							 "//    public override void _Process(float delta)\n"
+							 "//    {\n"
+							 "//        // Called every frame. Delta is time since last frame.\n"
+							 "//        // Update game logic here.\n"
+							 "//        \n"
+							 "//    }\n"
+							 "//}\n";
 
 	script_template = script_template.replace("%BASE_CLASS_NAME%", p_base_class_name).replace("%CLASS_NAME%", p_class_name);