mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
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 <arnfranke@yahoo.com>
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user