diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-11-09 08:29:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-09 08:29:44 +0100 |
commit | 593e35346ab182c36068c3dcfc741eeb7311a19e (patch) | |
tree | b286b8551eefaf417bb39f52837c6a375772f0cc /doc/classes/EditorScript.xml | |
parent | 4206dc6ac95bed86d8f8d040a0e1b73431cdb750 (diff) | |
parent | 8fb113bb4c3d70c5952924031dffa6b850263207 (diff) |
Merge pull request #42841 from HaSa1002/docs-lang-3
Port code examples to C# (D and E)
Diffstat (limited to 'doc/classes/EditorScript.xml')
-rw-r--r-- | doc/classes/EditorScript.xml | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/doc/classes/EditorScript.xml b/doc/classes/EditorScript.xml index e96044bf48..60ccf451b8 100644 --- a/doc/classes/EditorScript.xml +++ b/doc/classes/EditorScript.xml @@ -7,13 +7,28 @@ Scripts extending this class and implementing its [method _run] method can be executed from the Script Editor's [b]File > Run[/b] menu option (or by pressing [kbd]Ctrl + Shift + X[/kbd]) while the editor is running. This is useful for adding custom in-editor functionality to Godot. For more complex additions, consider using [EditorPlugin]s instead. [b]Note:[/b] Extending scripts need to have [code]tool[/code] mode enabled. [b]Example script:[/b] - [codeblock] + [codeblocks] + [gdscript] tool extends EditorScript func _run(): print("Hello from the Godot Editor!") - [/codeblock] + [/gdscript] + [csharp] + using Godot; + using System; + + [Tool] + public class HelloEditor : EditorScript + { + public override void _Run() + { + GD.Print("Hello from the Godot Editor!"); + } + } + [/csharp] + [/codeblocks] [b]Note:[/b] The script is run in the Editor context, which means the output is visible in the console window started with the Editor (stdout) instead of the usual Godot [b]Output[/b] dock. </description> <tutorials> |