diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-10-23 23:18:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-23 23:18:14 +0200 |
commit | 8ef79ffe6838ae1710836f535884df296fe83d78 (patch) | |
tree | 6f837ae36d22c28fd540e31bedfeab3b8d1869c0 | |
parent | 19f83e57de89c91cfe956759e9be725bbeb20c1e (diff) | |
parent | ba779c1c0c5315ed0aea9799e8930975e1948f17 (diff) |
Merge pull request #12320 from mhilbrunner/issue-11994
Add _process(delta) to new script templates. Closes #11994.
-rw-r--r-- | modules/gdscript/gd_editor.cpp | 6 | ||||
-rw-r--r-- | modules/mono/csharp_script.cpp | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index b0408917a4..9d37703357 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/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()); diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index ba8c7df9cc..7143177c3f 100644 --- a/modules/mono/csharp_script.cpp +++ b/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); |