EditorScript¶
Script base que puede ser usado para añadir funciones de extensión al editor.
Descripción¶
Scripts extending this class and implementing its _run method can be executed from the Script Editor's File > Run menu option (or by pressing Ctrl+Shift+X
) while the editor is running. This is useful for adding custom in-editor functionality to Godot. For more complex additions, consider using EditorPlugins instead.
Note: Extending scripts need to have tool
mode enabled.
Example script:
tool
extends EditorScript
func _run():
print("Hello from the Godot Editor!")
Note: 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 Output dock.
Métodos¶
void |
_run ( ) virtual |
void |
add_root_node ( Node node ) |
get_scene ( ) |
Descripciones de Métodos¶
void _run ( ) virtual
Este método es ejecutado por el Editor cuando se utiliza Archivo > Ejecutar.
void add_root_node ( Node node )
Añade el node
como hijo del nodo raíz en el contexto del editor.
Advertencia: La implementación de este método está actualmente desactivada.
EditorInterface get_editor_interface ( )
Devuelve la instancia del singleton EditorInterface.
Node get_scene ( )
Devuelve la escena actualmente activa del editor.