From 8fb113bb4c3d70c5952924031dffa6b850263207 Mon Sep 17 00:00:00 2001 From: HaSa1002 Date: Sun, 13 Sep 2020 14:45:36 +0200 Subject: Port code examples to C# (D) Includes: * Decal * Dictionary * Directory * DisplayServer * DTLSServer * DynamicFont * EditorImportPlugin * EditorPlugin * EditorScenePostImport * EditorScript * EditorSettings * EditorTranslationParserPlugin * Engine * Expression Co-authored-by: Aaron Franke --- doc/classes/EditorScript.xml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'doc/classes/EditorScript.xml') 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. -- cgit v1.2.3