Merge pull request #12320 from mhilbrunner/issue-11994

Add _process(delta) to new script templates. Closes #11994.
This commit is contained in:
Rémi Verschelde 2017-10-23 23:18:14 +02:00 committed by GitHub
commit 8ef79ffe68
2 changed files with 13 additions and 2 deletions

View File

@ -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());

View File

@ -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);