diff options
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> |