Class ScriptEditor
- Namespace
- Godot
- Assembly
- GodotSharpEditor.dll
Godot editor's script editor.
Note: This class shouldn't be instantiated directly. Instead, access the singleton using GetScriptEditor().
public class ScriptEditor : PanelContainer, IDisposable
- Inheritance
-
ScriptEditor
- Implements
- Inherited Members
Methods
GetCurrentEditor()
Returns the ScriptEditorBase object that the user is currently editing.
public ScriptEditorBase GetCurrentEditor()
Returns
GetCurrentScript()
Returns a Script that is currently active in editor.
public Script GetCurrentScript()
Returns
GetOpenScriptEditors()
Returns an array with all ScriptEditorBase objects which are currently open in editor.
public Array<ScriptEditorBase> GetOpenScriptEditors()
Returns
GetOpenScripts()
Returns an array with all Script objects which are currently open in editor.
public Array<Script> GetOpenScripts()
Returns
GotoLine(int)
Goes to the specified line in the current script.
public void GotoLine(int lineNumber)
Parameters
lineNumber
int
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
OpenScriptCreateDialog(string, string)
Opens the script create dialog. The script will extend baseName
. The file extension can be omitted from basePath
. It will be added based on the selected scripting language.
public void OpenScriptCreateDialog(string baseName, string basePath)
Parameters
RegisterSyntaxHighlighter(EditorSyntaxHighlighter)
Registers the EditorSyntaxHighlighter to the editor, the EditorSyntaxHighlighter will be available on all open scripts.
Note: Does not apply to scripts that are already opened.
public void RegisterSyntaxHighlighter(EditorSyntaxHighlighter syntaxHighlighter)
Parameters
syntaxHighlighter
EditorSyntaxHighlighter
UnregisterSyntaxHighlighter(EditorSyntaxHighlighter)
Unregisters the EditorSyntaxHighlighter from the editor.
Note: The EditorSyntaxHighlighter will still be applied to scripts that are already opened.
public void UnregisterSyntaxHighlighter(EditorSyntaxHighlighter syntaxHighlighter)
Parameters
syntaxHighlighter
EditorSyntaxHighlighter
Events
EditorScriptChanged
Emitted when user changed active script. Argument is a freshly activated Script.
public event ScriptEditor.EditorScriptChangedEventHandler EditorScriptChanged
Event Type
ScriptClose
Emitted when editor is about to close the active script. Argument is a Script that is going to be closed.
public event ScriptEditor.ScriptCloseEventHandler ScriptClose