mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
1120 lines
94 KiB
ReStructuredText
1120 lines
94 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_EditorInterface:
|
||
|
||
EditorInterface
|
||
===============
|
||
|
||
**继承:** :ref:`Object<class_Object>`
|
||
|
||
Godot 编辑器的接口。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
描述
|
||
----
|
||
|
||
**EditorInterface** 允许控制 Godot 编辑器的窗口,包括自定义窗口,保存和重新加载场景,渲染网格预览,检查和编辑资源和对象,并提供对 :ref:`EditorSettings<class_EditorSettings>` , :ref:`EditorFileSystem<class_EditorFileSystem>` , :ref:`EditorResourcePreview<class_EditorResourcePreview>` , :ref:`ScriptEditor<class_ScriptEditor>` ,编辑器视口以及场景信息的访问。
|
||
|
||
\ **注意:** 这个类不应该被直接实例化。而是,直接通过名称访问单例。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
var editor_settings = EditorInterface.get_editor_settings()
|
||
|
||
.. code-tab:: csharp
|
||
|
||
// 在 C# 中,可以通过静态 Singleton 属性来访问。
|
||
EditorSettings settings = EditorInterface.Singleton.GetEditorSettings();
|
||
|
||
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
属性
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------+------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`distraction_free_mode<class_EditorInterface_property_distraction_free_mode>` |
|
||
+-------------------------+------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`movie_maker_enabled<class_EditorInterface_property_movie_maker_enabled>` |
|
||
+-------------------------+------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
方法
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`add_root_node<class_EditorInterface_method_add_root_node>`\ (\ node\: :ref:`Node<class_Node>`\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`close_scene<class_EditorInterface_method_close_scene>`\ (\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`edit_node<class_EditorInterface_method_edit_node>`\ (\ node\: :ref:`Node<class_Node>`\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`edit_resource<class_EditorInterface_method_edit_resource>`\ (\ resource\: :ref:`Resource<class_Resource>`\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`edit_script<class_EditorInterface_method_edit_script>`\ (\ script\: :ref:`Script<class_Script>`, line\: :ref:`int<class_int>` = -1, column\: :ref:`int<class_int>` = 0, grab_focus\: :ref:`bool<class_bool>` = true\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Control<class_Control>` | :ref:`get_base_control<class_EditorInterface_method_get_base_control>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`EditorCommandPalette<class_EditorCommandPalette>` | :ref:`get_command_palette<class_EditorInterface_method_get_command_palette>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`get_current_directory<class_EditorInterface_method_get_current_directory>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`get_current_feature_profile<class_EditorInterface_method_get_current_feature_profile>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`get_current_path<class_EditorInterface_method_get_current_path>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Node<class_Node>` | :ref:`get_edited_scene_root<class_EditorInterface_method_get_edited_scene_root>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`get_editor_language<class_EditorInterface_method_get_editor_language>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`VBoxContainer<class_VBoxContainer>` | :ref:`get_editor_main_screen<class_EditorInterface_method_get_editor_main_screen>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`EditorPaths<class_EditorPaths>` | :ref:`get_editor_paths<class_EditorInterface_method_get_editor_paths>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`get_editor_scale<class_EditorInterface_method_get_editor_scale>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`EditorSettings<class_EditorSettings>` | :ref:`get_editor_settings<class_EditorInterface_method_get_editor_settings>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Theme<class_Theme>` | :ref:`get_editor_theme<class_EditorInterface_method_get_editor_theme>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`EditorToaster<class_EditorToaster>` | :ref:`get_editor_toaster<class_EditorInterface_method_get_editor_toaster>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`EditorUndoRedoManager<class_EditorUndoRedoManager>` | :ref:`get_editor_undo_redo<class_EditorInterface_method_get_editor_undo_redo>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`SubViewport<class_SubViewport>` | :ref:`get_editor_viewport_2d<class_EditorInterface_method_get_editor_viewport_2d>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`SubViewport<class_SubViewport>` | :ref:`get_editor_viewport_3d<class_EditorInterface_method_get_editor_viewport_3d>`\ (\ idx\: :ref:`int<class_int>` = 0\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`FileSystemDock<class_FileSystemDock>` | :ref:`get_file_system_dock<class_EditorInterface_method_get_file_system_dock>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`EditorInspector<class_EditorInspector>` | :ref:`get_inspector<class_EditorInterface_method_get_inspector>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`get_node_3d_rotate_snap<class_EditorInterface_method_get_node_3d_rotate_snap>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`get_node_3d_scale_snap<class_EditorInterface_method_get_node_3d_scale_snap>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`get_node_3d_translate_snap<class_EditorInterface_method_get_node_3d_translate_snap>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] | :ref:`get_open_scene_roots<class_EditorInterface_method_get_open_scene_roots>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_open_scenes<class_EditorInterface_method_get_open_scenes>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`get_playing_scene<class_EditorInterface_method_get_playing_scene>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`EditorFileSystem<class_EditorFileSystem>` | :ref:`get_resource_filesystem<class_EditorInterface_method_get_resource_filesystem>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`EditorResourcePreview<class_EditorResourcePreview>` | :ref:`get_resource_previewer<class_EditorInterface_method_get_resource_previewer>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`ScriptEditor<class_ScriptEditor>` | :ref:`get_script_editor<class_EditorInterface_method_get_script_editor>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_selected_paths<class_EditorInterface_method_get_selected_paths>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`EditorSelection<class_EditorSelection>` | :ref:`get_selection<class_EditorInterface_method_get_selection>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`inspect_object<class_EditorInterface_method_inspect_object>`\ (\ object\: :ref:`Object<class_Object>`, for_property\: :ref:`String<class_String>` = "", inspector_only\: :ref:`bool<class_bool>` = false\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_multi_window_enabled<class_EditorInterface_method_is_multi_window_enabled>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_node_3d_snap_enabled<class_EditorInterface_method_is_node_3d_snap_enabled>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_object_edited<class_EditorInterface_method_is_object_edited>`\ (\ object\: :ref:`Object<class_Object>`\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_playing_scene<class_EditorInterface_method_is_playing_scene>`\ (\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_plugin_enabled<class_EditorInterface_method_is_plugin_enabled>`\ (\ plugin\: :ref:`String<class_String>`\ ) |const| |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Array<class_Array>`\[:ref:`Texture2D<class_Texture2D>`\] | :ref:`make_mesh_previews<class_EditorInterface_method_make_mesh_previews>`\ (\ meshes\: :ref:`Array<class_Array>`\[:ref:`Mesh<class_Mesh>`\], preview_size\: :ref:`int<class_int>`\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`mark_scene_as_unsaved<class_EditorInterface_method_mark_scene_as_unsaved>`\ (\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`open_scene_from_path<class_EditorInterface_method_open_scene_from_path>`\ (\ scene_filepath\: :ref:`String<class_String>`, set_inherited\: :ref:`bool<class_bool>` = false\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`play_current_scene<class_EditorInterface_method_play_current_scene>`\ (\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`play_custom_scene<class_EditorInterface_method_play_custom_scene>`\ (\ scene_filepath\: :ref:`String<class_String>`\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`play_main_scene<class_EditorInterface_method_play_main_scene>`\ (\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_create_dialog<class_EditorInterface_method_popup_create_dialog>`\ (\ callback\: :ref:`Callable<class_Callable>`, base_type\: :ref:`StringName<class_StringName>` = "", current_type\: :ref:`String<class_String>` = "", dialog_title\: :ref:`String<class_String>` = "", type_blocklist\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] = []\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_dialog<class_EditorInterface_method_popup_dialog>`\ (\ dialog\: :ref:`Window<class_Window>`, rect\: :ref:`Rect2i<class_Rect2i>` = Rect2i(0, 0, 0, 0)\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_dialog_centered<class_EditorInterface_method_popup_dialog_centered>`\ (\ dialog\: :ref:`Window<class_Window>`, minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0)\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_dialog_centered_clamped<class_EditorInterface_method_popup_dialog_centered_clamped>`\ (\ dialog\: :ref:`Window<class_Window>`, minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0), fallback_ratio\: :ref:`float<class_float>` = 0.75\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_dialog_centered_ratio<class_EditorInterface_method_popup_dialog_centered_ratio>`\ (\ dialog\: :ref:`Window<class_Window>`, ratio\: :ref:`float<class_float>` = 0.8\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_method_selector<class_EditorInterface_method_popup_method_selector>`\ (\ object\: :ref:`Object<class_Object>`, callback\: :ref:`Callable<class_Callable>`, current_value\: :ref:`String<class_String>` = ""\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_node_selector<class_EditorInterface_method_popup_node_selector>`\ (\ callback\: :ref:`Callable<class_Callable>`, valid_types\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] = [], current_value\: :ref:`Node<class_Node>` = null\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_property_selector<class_EditorInterface_method_popup_property_selector>`\ (\ object\: :ref:`Object<class_Object>`, callback\: :ref:`Callable<class_Callable>`, type_filter\: :ref:`PackedInt32Array<class_PackedInt32Array>` = PackedInt32Array(), current_value\: :ref:`String<class_String>` = ""\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_quick_open<class_EditorInterface_method_popup_quick_open>`\ (\ callback\: :ref:`Callable<class_Callable>`, base_types\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] = []\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`reload_scene_from_path<class_EditorInterface_method_reload_scene_from_path>`\ (\ scene_filepath\: :ref:`String<class_String>`\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`restart_editor<class_EditorInterface_method_restart_editor>`\ (\ save\: :ref:`bool<class_bool>` = true\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`save_all_scenes<class_EditorInterface_method_save_all_scenes>`\ (\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_scene<class_EditorInterface_method_save_scene>`\ (\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`save_scene_as<class_EditorInterface_method_save_scene_as>`\ (\ path\: :ref:`String<class_String>`, with_preview\: :ref:`bool<class_bool>` = true\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`select_file<class_EditorInterface_method_select_file>`\ (\ file\: :ref:`String<class_String>`\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_current_feature_profile<class_EditorInterface_method_set_current_feature_profile>`\ (\ profile_name\: :ref:`String<class_String>`\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_main_screen_editor<class_EditorInterface_method_set_main_screen_editor>`\ (\ name\: :ref:`String<class_String>`\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_object_edited<class_EditorInterface_method_set_object_edited>`\ (\ object\: :ref:`Object<class_Object>`, edited\: :ref:`bool<class_bool>`\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_plugin_enabled<class_EditorInterface_method_set_plugin_enabled>`\ (\ plugin\: :ref:`String<class_String>`, enabled\: :ref:`bool<class_bool>`\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`stop_playing_scene<class_EditorInterface_method_stop_playing_scene>`\ (\ ) |
|
||
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
属性说明
|
||
--------
|
||
|
||
.. _class_EditorInterface_property_distraction_free_mode:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **distraction_free_mode** :ref:`🔗<class_EditorInterface_property_distraction_free_mode>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_distraction_free_mode**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_distraction_free_mode_enabled**\ (\ )
|
||
|
||
如果为 ``true``\ ,将启用专注模式,该模式会隐藏侧边面板,增加主视图的可用空间。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_property_movie_maker_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **movie_maker_enabled** :ref:`🔗<class_EditorInterface_property_movie_maker_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_movie_maker_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_movie_maker_enabled**\ (\ )
|
||
|
||
如果为 ``true``\ ,则编辑器启用了 Movie Maker 模式。详见 :ref:`MovieWriter<class_MovieWriter>`\ 。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
方法说明
|
||
--------
|
||
|
||
.. _class_EditorInterface_method_add_root_node:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **add_root_node**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`🔗<class_EditorInterface_method_add_root_node>`
|
||
|
||
使 ``node`` 成为当前打开的场景的根。仅当场景为空时才有效。如果 ``node`` 是场景实例,则会创建一个继承场景。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_close_scene:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **close_scene**\ (\ ) :ref:`🔗<class_EditorInterface_method_close_scene>`
|
||
|
||
关闭当前活动的场景,关闭过程中忽略未保存的更改。成功时返回 :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>`\ ,如果没有可关闭的场景则返回 :ref:`@GlobalScope.ERR_DOES_NOT_EXIST<class_@GlobalScope_constant_ERR_DOES_NOT_EXIST>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_edit_node:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **edit_node**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`🔗<class_EditorInterface_method_edit_node>`
|
||
|
||
编辑给定的 :ref:`Node<class_Node>`\ 。如果该节点在场景树内,将被选中。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_edit_resource:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **edit_resource**\ (\ resource\: :ref:`Resource<class_Resource>`\ ) :ref:`🔗<class_EditorInterface_method_edit_resource>`
|
||
|
||
编辑给定的 :ref:`Resource<class_Resource>`\ 。如果该资源是 :ref:`Script<class_Script>`\ ,你还可以使用 :ref:`edit_script()<class_EditorInterface_method_edit_script>` 编辑,指定行列位置。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_edit_script:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **edit_script**\ (\ script\: :ref:`Script<class_Script>`, line\: :ref:`int<class_int>` = -1, column\: :ref:`int<class_int>` = 0, grab_focus\: :ref:`bool<class_bool>` = true\ ) :ref:`🔗<class_EditorInterface_method_edit_script>`
|
||
|
||
编辑给定的 :ref:`Script<class_Script>`\ 。还可以指定所打开脚本的行和列。打开脚本所使用的编辑器是由用户为该脚本的语言所配置,可能是外部编辑器。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_base_control:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Control<class_Control>` **get_base_control**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_base_control>`
|
||
|
||
返回 Godot 编辑器窗口的主容器。例如,你可以用它来检索容器的大小并相应地放置你的控件。
|
||
|
||
\ **警告:**\ 删除和释放这个节点将使编辑器失效,并可能导致崩溃。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_command_palette:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`EditorCommandPalette<class_EditorCommandPalette>` **get_command_palette**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_command_palette>`
|
||
|
||
返回编辑器的 :ref:`EditorCommandPalette<class_EditorCommandPalette>` 实例。
|
||
|
||
\ **警告:**\ 删除和释放此节点,将使编辑器的一部分失去作用,并可能导致崩溃。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_current_directory:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **get_current_directory**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_current_directory>`
|
||
|
||
返回 :ref:`FileSystemDock<class_FileSystemDock>` 中当前正在查看的目录。如果选择了一个文件,则将使用 :ref:`String.get_base_dir()<class_String_method_get_base_dir>` 返回其基本目录。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_current_feature_profile:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **get_current_feature_profile**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_current_feature_profile>`
|
||
|
||
返回当前激活的功能配置文件的名称。如果默认配置文件当前处于活动状态,则返回空字符串。
|
||
|
||
为了获取对 :ref:`EditorFeatureProfile<class_EditorFeatureProfile>` 的引用,你必须使用 :ref:`EditorFeatureProfile.load_from_file()<class_EditorFeatureProfile_method_load_from_file>` 加载该功能配置文件。
|
||
|
||
\ **注意:**\ 通过用户界面创建的功能配置文件将从 ``feature_profiles`` 目录中的扩展名为 ``.profile`` 的文件加载。可以使用 :ref:`EditorPaths.get_config_dir()<class_EditorPaths_method_get_config_dir>` 找到编辑器配置文件夹。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_current_path:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **get_current_path**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_current_path>`
|
||
|
||
返回在 :ref:`FileSystemDock<class_FileSystemDock>` 中查看的当前路径。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_edited_scene_root:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Node<class_Node>` **get_edited_scene_root**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_edited_scene_root>`
|
||
|
||
返回正在编辑的(当前)场景的根 :ref:`Node<class_Node>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_editor_language:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **get_editor_language**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_editor_language>`
|
||
|
||
Returns the language currently used for the editor interface.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_editor_main_screen:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`VBoxContainer<class_VBoxContainer>` **get_editor_main_screen**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_editor_main_screen>`
|
||
|
||
返回负责主屏幕插件和工具的编辑器控件。将其与实现了 :ref:`EditorPlugin._has_main_screen()<class_EditorPlugin_private_method__has_main_screen>` 的插件一起使用。
|
||
|
||
\ **注意:**\ 该节点是一个 :ref:`VBoxContainer<class_VBoxContainer>`\ ,这意味着如果向其添加 :ref:`Control<class_Control>` 子节点,则需要将子节点的 :ref:`Control.size_flags_vertical<class_Control_property_size_flags_vertical>` 设置为 :ref:`Control.SIZE_EXPAND_FILL<class_Control_constant_SIZE_EXPAND_FILL>`\ ,以使其使用全部可用空间。
|
||
|
||
\ **警告:**\ 移除和释放这个节点将使编辑器的一部分失去作用,并可能导致崩溃。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_editor_paths:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`EditorPaths<class_EditorPaths>` **get_editor_paths**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_editor_paths>`
|
||
|
||
返回 :ref:`EditorPaths<class_EditorPaths>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_editor_scale:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **get_editor_scale**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_editor_scale>`
|
||
|
||
返回编辑器 UI 的实际缩放(\ ``1.0`` 表示缩放为 100%)。可以用来调整由插件添加的用户 UI 的位置和尺寸。
|
||
|
||
\ **注意:**\ 这个值是通过 :ref:`EditorSettings.interface/editor/display_scale<class_EditorSettings_property_interface/editor/display_scale>` 和 :ref:`EditorSettings.interface/editor/custom_display_scale<class_EditorSettings_property_interface/editor/custom_display_scale>` 来设置。编辑器必须重新启动才能正确应用这些变化。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_editor_settings:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`EditorSettings<class_EditorSettings>` **get_editor_settings**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_editor_settings>`
|
||
|
||
返回编辑器的 :ref:`EditorSettings<class_EditorSettings>` 实例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_editor_theme:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Theme<class_Theme>` **get_editor_theme**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_editor_theme>`
|
||
|
||
返回编辑器的 :ref:`Theme<class_Theme>`\ 。
|
||
|
||
\ **注意:**\ 创建自定义编辑器 UI 时,请优先直接通过 GUI 节点的 ``get_theme_*`` 方法来访问主题项目。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_editor_toaster:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`EditorToaster<class_EditorToaster>` **get_editor_toaster**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_editor_toaster>`
|
||
|
||
返回编辑器的 :ref:`EditorToaster<class_EditorToaster>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_editor_undo_redo:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`EditorUndoRedoManager<class_EditorUndoRedoManager>` **get_editor_undo_redo**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_editor_undo_redo>`
|
||
|
||
返回编辑器的 :ref:`EditorUndoRedoManager<class_EditorUndoRedoManager>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_editor_viewport_2d:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`SubViewport<class_SubViewport>` **get_editor_viewport_2d**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_editor_viewport_2d>`
|
||
|
||
返回 2D 编辑器 :ref:`SubViewport<class_SubViewport>`\ 。视口中没有相机。视图是直接进行变换的,可以使用 :ref:`Viewport.global_canvas_transform<class_Viewport_property_global_canvas_transform>` 访问。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_editor_viewport_3d:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`SubViewport<class_SubViewport>` **get_editor_viewport_3d**\ (\ idx\: :ref:`int<class_int>` = 0\ ) |const| :ref:`🔗<class_EditorInterface_method_get_editor_viewport_3d>`
|
||
|
||
返回指定的 3D 编辑器 :ref:`SubViewport<class_SubViewport>`\ ,编号从 ``0`` 到 ``3``\ 。可以通过 :ref:`Viewport.get_camera_3d()<class_Viewport_method_get_camera_3d>` 访问视口中的活动编辑器相机。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_file_system_dock:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`FileSystemDock<class_FileSystemDock>` **get_file_system_dock**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_file_system_dock>`
|
||
|
||
返回编辑器的文件系统面板 :ref:`FileSystemDock<class_FileSystemDock>` 实例。
|
||
|
||
\ **警告:**\ 移除和释放此节点将使编辑器的一部分失去作用,并可能导致崩溃。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_inspector:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`EditorInspector<class_EditorInspector>` **get_inspector**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_inspector>`
|
||
|
||
返回编辑器的属性检查器 :ref:`EditorInspector<class_EditorInspector>`\ 实例。
|
||
|
||
\ **警告:**\ 删除和释放这个节点将使编辑器的一部分失去作用,并可能导致崩溃。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_node_3d_rotate_snap:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **get_node_3d_rotate_snap**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_node_3d_rotate_snap>`
|
||
|
||
Returns the amount of degrees the 3D editor's rotational snapping is set to.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_node_3d_scale_snap:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **get_node_3d_scale_snap**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_node_3d_scale_snap>`
|
||
|
||
Returns the amount of units the 3D editor's scale snapping is set to.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_node_3d_translate_snap:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **get_node_3d_translate_snap**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_node_3d_translate_snap>`
|
||
|
||
Returns the amount of units the 3D editor's translation snapping is set to.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_open_scene_roots:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] **get_open_scene_roots**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_open_scene_roots>`
|
||
|
||
返回包含当前所有已打开场景的根节点的数组。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_open_scenes:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_open_scenes**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_open_scenes>`
|
||
|
||
返回包含当前所有已打开场景的文件路径的数组。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_playing_scene:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **get_playing_scene**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_playing_scene>`
|
||
|
||
返回正在播放的场景名称。如果当前没有场景正在播放,返回一个空字符串。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_resource_filesystem:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`EditorFileSystem<class_EditorFileSystem>` **get_resource_filesystem**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_resource_filesystem>`
|
||
|
||
返回编辑器的 :ref:`EditorFileSystem<class_EditorFileSystem>` 实例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_resource_previewer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`EditorResourcePreview<class_EditorResourcePreview>` **get_resource_previewer**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_resource_previewer>`
|
||
|
||
返回编辑器的 :ref:`EditorResourcePreview<class_EditorResourcePreview>` 实例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_script_editor:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`ScriptEditor<class_ScriptEditor>` **get_script_editor**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_script_editor>`
|
||
|
||
返回编辑器的脚本编辑器 :ref:`ScriptEditor<class_ScriptEditor>` 实例。
|
||
|
||
\ **警告:**\ 删除和释放这个节点将使编辑器的一部分失去作用,并可能导致崩溃。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_selected_paths:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_selected_paths**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_selected_paths>`
|
||
|
||
返回一个包含了 :ref:`FileSystemDock<class_FileSystemDock>` 中当前所选文件(和目录)路径的数组。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_get_selection:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`EditorSelection<class_EditorSelection>` **get_selection**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_get_selection>`
|
||
|
||
返回编辑器的 :ref:`EditorSelection<class_EditorSelection>` 实例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_inspect_object:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **inspect_object**\ (\ object\: :ref:`Object<class_Object>`, for_property\: :ref:`String<class_String>` = "", inspector_only\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_EditorInterface_method_inspect_object>`
|
||
|
||
在编辑器的检查器面板中显示给定 ``object`` 的属性。如果 ``inspector_only`` 为 ``true`` ,插件将不会试图编辑 ``object``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_is_multi_window_enabled:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_multi_window_enabled**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_is_multi_window_enabled>`
|
||
|
||
如果编辑器启用了多窗口支持,则返回 ``true``\ 。以下所有条件\ *都满足*\ 时才会启用多窗口支持:
|
||
|
||
- :ref:`EditorSettings.interface/multi_window/enable<class_EditorSettings_property_interface/multi_window/enable>` 为 ``true``\ 。
|
||
|
||
- :ref:`EditorSettings.interface/editor/single_window_mode<class_EditorSettings_property_interface/editor/single_window_mode>` 为 ``false``\ 。
|
||
|
||
- :ref:`Viewport.gui_embed_subwindows<class_Viewport_property_gui_embed_subwindows>` 为 ``false``\ 。如果平台是 Web 等不支持多窗口的平台,或者使用了 ``--single-window`` :doc:`命令行参数 <../tutorials/editor/command_line_tutorial>`\ ,则强制为 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_is_node_3d_snap_enabled:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_node_3d_snap_enabled**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_is_node_3d_snap_enabled>`
|
||
|
||
Returns ``true`` if the 3D editor currently has snapping mode enabled, and ``false`` otherwise.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_is_object_edited:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_object_edited**\ (\ object\: :ref:`Object<class_Object>`\ ) |const| :ref:`🔗<class_EditorInterface_method_is_object_edited>`
|
||
|
||
Returns ``true`` if the object has been marked as edited through :ref:`set_object_edited()<class_EditorInterface_method_set_object_edited>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_is_playing_scene:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_playing_scene**\ (\ ) |const| :ref:`🔗<class_EditorInterface_method_is_playing_scene>`
|
||
|
||
如果场景正在播放,返回 ``true``\ ,否则返回 ``false``\ 。暂停的场景将被视为正在播放。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_is_plugin_enabled:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_plugin_enabled**\ (\ plugin\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_EditorInterface_method_is_plugin_enabled>`
|
||
|
||
如果启用了指定的 ``plugin``\ ,则返回 ``true``\ 。插件名称与其目录名称相同。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_make_mesh_previews:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Array<class_Array>`\[:ref:`Texture2D<class_Texture2D>`\] **make_mesh_previews**\ (\ meshes\: :ref:`Array<class_Array>`\[:ref:`Mesh<class_Mesh>`\], preview_size\: :ref:`int<class_int>`\ ) :ref:`🔗<class_EditorInterface_method_make_mesh_previews>`
|
||
|
||
将以给定大小渲染的网格预览返回为元素类型为 :ref:`Texture2D<class_Texture2D>` 的一个 :ref:`Array<class_Array>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_mark_scene_as_unsaved:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **mark_scene_as_unsaved**\ (\ ) :ref:`🔗<class_EditorInterface_method_mark_scene_as_unsaved>`
|
||
|
||
将当前场景选项卡标记为未保存。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_open_scene_from_path:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **open_scene_from_path**\ (\ scene_filepath\: :ref:`String<class_String>`, set_inherited\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_EditorInterface_method_open_scene_from_path>`
|
||
|
||
打开位于给定路径的场景。如果 ``set_inherited`` 为 ``true``\ ,则会创建新的继承场景。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_play_current_scene:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **play_current_scene**\ (\ ) :ref:`🔗<class_EditorInterface_method_play_current_scene>`
|
||
|
||
播放当前活动的场景。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_play_custom_scene:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **play_custom_scene**\ (\ scene_filepath\: :ref:`String<class_String>`\ ) :ref:`🔗<class_EditorInterface_method_play_custom_scene>`
|
||
|
||
播放文件路径所指定的场景。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_play_main_scene:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **play_main_scene**\ (\ ) :ref:`🔗<class_EditorInterface_method_play_main_scene>`
|
||
|
||
播放主场景。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_popup_create_dialog:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_create_dialog**\ (\ callback\: :ref:`Callable<class_Callable>`, base_type\: :ref:`StringName<class_StringName>` = "", current_type\: :ref:`String<class_String>` = "", dialog_title\: :ref:`String<class_String>` = "", type_blocklist\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] = []\ ) :ref:`🔗<class_EditorInterface_method_popup_create_dialog>`
|
||
|
||
**实验性:** 未来版本中可能会修改或移除该方法。
|
||
|
||
Pops up an editor dialog for creating an object.
|
||
|
||
The ``callback`` must take a single argument of type :ref:`String<class_String>`, which will contain the type name of the selected object (or the script path of the type, if the type is created from a script), or be an empty string if no item is selected.
|
||
|
||
The ``base_type`` specifies the base type of objects to display. For example, if you set this to "Resource", all types derived from :ref:`Resource<class_Resource>` will display in the create dialog.
|
||
|
||
The ``current_type`` will be passed in the search box of the create dialog, and the specified type can be immediately selected when the dialog pops up. If the ``current_type`` is not derived from ``base_type``, there will be no result of the type in the dialog.
|
||
|
||
The ``dialog_title`` allows you to define a custom title for the dialog. This is useful if you want to accurately hint the usage of the dialog. If the ``dialog_title`` is an empty string, the dialog will use "Create New 'Base Type'" as the default title.
|
||
|
||
The ``type_blocklist`` contains a list of type names, and the types in the blocklist will be hidden from the create dialog.
|
||
|
||
\ **Note:** Trying to list the base type in the ``type_blocklist`` will hide all types derived from the base type from the create dialog.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_popup_dialog:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_dialog**\ (\ dialog\: :ref:`Window<class_Window>`, rect\: :ref:`Rect2i<class_Rect2i>` = Rect2i(0, 0, 0, 0)\ ) :ref:`🔗<class_EditorInterface_method_popup_dialog>`
|
||
|
||
使用 :ref:`Window.popup_exclusive()<class_Window_method_popup_exclusive>` 在编辑器 UI 中弹出 ``dialog``\ 。该对话框目前必须没有父级,否则该方法失败。
|
||
|
||
另见 :ref:`Window.set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_popup_dialog_centered:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_dialog_centered**\ (\ dialog\: :ref:`Window<class_Window>`, minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0)\ ) :ref:`🔗<class_EditorInterface_method_popup_dialog_centered>`
|
||
|
||
使用 :ref:`Window.popup_exclusive_centered()<class_Window_method_popup_exclusive_centered>` 在编辑器 UI 中弹出 ``dialog``\ 。该对话框目前必须没有父级,否则该方法失败。
|
||
|
||
另见 :ref:`Window.set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_popup_dialog_centered_clamped:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_dialog_centered_clamped**\ (\ dialog\: :ref:`Window<class_Window>`, minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0), fallback_ratio\: :ref:`float<class_float>` = 0.75\ ) :ref:`🔗<class_EditorInterface_method_popup_dialog_centered_clamped>`
|
||
|
||
使用 :ref:`Window.popup_exclusive_centered_clamped()<class_Window_method_popup_exclusive_centered_clamped>` 在编辑器 UI 中弹出 ``dialog``\ 。该对话框目前必须没有父级,否则该方法失败。
|
||
|
||
另见 :ref:`Window.set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_popup_dialog_centered_ratio:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_dialog_centered_ratio**\ (\ dialog\: :ref:`Window<class_Window>`, ratio\: :ref:`float<class_float>` = 0.8\ ) :ref:`🔗<class_EditorInterface_method_popup_dialog_centered_ratio>`
|
||
|
||
使用 :ref:`Window.popup_exclusive_centered_ratio()<class_Window_method_popup_exclusive_centered_ratio>` 在编辑器 UI 中弹出 ``dialog``\ 。该对话框目前必须没有父级,否则该方法失败。
|
||
|
||
另见 :ref:`Window.set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_popup_method_selector:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_method_selector**\ (\ object\: :ref:`Object<class_Object>`, callback\: :ref:`Callable<class_Callable>`, current_value\: :ref:`String<class_String>` = ""\ ) :ref:`🔗<class_EditorInterface_method_popup_method_selector>`
|
||
|
||
弹出编辑器对话框,用于选择 ``object`` 的方法。\ ``callback`` 回调必须接受单个 :ref:`String<class_String>` 类型的参数,其中包含的是所选方法的名称,取消对话框时则为空。如果提供了 ``current_value`` 且对应方法存在,则会在方法列表中自动选中该方法。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_popup_node_selector:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_node_selector**\ (\ callback\: :ref:`Callable<class_Callable>`, valid_types\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] = [], current_value\: :ref:`Node<class_Node>` = null\ ) :ref:`🔗<class_EditorInterface_method_popup_node_selector>`
|
||
|
||
弹出编辑器对话框,用于选择所编辑场景中的 :ref:`Node<class_Node>`\ 。\ ``callback`` 必须接受单个类型为 :ref:`NodePath<class_NodePath>` 的参数。调用回调时会传入所选 :ref:`NodePath<class_NodePath>`\ ,取消对话框时则为空路径 ``^""``\ 。如果提供了 ``valid_types``\ ,则对话框只会显示与所列 Node 类型匹配的 Node。
|
||
|
||
\ **示例:**\ 节点首次加入场景树时显示节点选择对话框:
|
||
|
||
::
|
||
|
||
func _ready():
|
||
if Engine.is_editor_hint():
|
||
EditorInterface.popup_node_selector(_on_node_selected, ["Button"])
|
||
|
||
func _on_node_selected(node_path):
|
||
if node_path.is_empty():
|
||
print("节点选择已取消")
|
||
else:
|
||
print("选中 ", node_path)
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_popup_property_selector:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_property_selector**\ (\ object\: :ref:`Object<class_Object>`, callback\: :ref:`Callable<class_Callable>`, type_filter\: :ref:`PackedInt32Array<class_PackedInt32Array>` = PackedInt32Array(), current_value\: :ref:`String<class_String>` = ""\ ) :ref:`🔗<class_EditorInterface_method_popup_property_selector>`
|
||
|
||
弹出编辑器对话框,用于选择 ``object`` 的属性。\ ``callback`` 必须接受单个类型为 :ref:`NodePath<class_NodePath>` 的参数。调用回调时会传入所选属性路径(见 :ref:`NodePath.get_as_property_path()<class_NodePath_method_get_as_property_path>`\ ),取消对话框时则为空路径 ``^""``\ 。如果提供了 ``type_filter``\ ,则对话框只会显示与所列 :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` 值匹配的属性。
|
||
|
||
::
|
||
|
||
func _ready():
|
||
if Engine.is_editor_hint():
|
||
EditorInterface.popup_property_selector(this, _on_property_selected, [TYPE_INT])
|
||
|
||
func _on_property_selected(property_path):
|
||
if property_path.is_empty():
|
||
print("属性选择已取消")
|
||
else:
|
||
print("选中 ", property_path)
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_popup_quick_open:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_quick_open**\ (\ callback\: :ref:`Callable<class_Callable>`, base_types\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] = []\ ) :ref:`🔗<class_EditorInterface_method_popup_quick_open>`
|
||
|
||
弹出编辑器对话框,用于快速选择资源文件。\ ``callback`` 回调必须接受单个 :ref:`String<class_String>` 类型的参数,其中包含的是所选资源的路径,取消对话框时则为空。如果提供了 ``base_types``\ ,则对话框中只会显示与这些类型相匹配的资源。仅支持派生自 :ref:`Resource<class_Resource>` 的类型。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_reload_scene_from_path:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **reload_scene_from_path**\ (\ scene_filepath\: :ref:`String<class_String>`\ ) :ref:`🔗<class_EditorInterface_method_reload_scene_from_path>`
|
||
|
||
重新加载给定路径的场景。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_restart_editor:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **restart_editor**\ (\ save\: :ref:`bool<class_bool>` = true\ ) :ref:`🔗<class_EditorInterface_method_restart_editor>`
|
||
|
||
重启编辑器。编辑器会关闭,然后再打开相同项目。如果 ``save`` 为 ``true``\ ,则重启前会保存项目。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_save_all_scenes:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **save_all_scenes**\ (\ ) :ref:`🔗<class_EditorInterface_method_save_all_scenes>`
|
||
|
||
保存编辑器中打开的所有场景。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_save_scene:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **save_scene**\ (\ ) :ref:`🔗<class_EditorInterface_method_save_scene>`
|
||
|
||
保存当前活动场景。返回 :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>` 或 :ref:`@GlobalScope.ERR_CANT_CREATE<class_@GlobalScope_constant_ERR_CANT_CREATE>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_save_scene_as:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **save_scene_as**\ (\ path\: :ref:`String<class_String>`, with_preview\: :ref:`bool<class_bool>` = true\ ) :ref:`🔗<class_EditorInterface_method_save_scene_as>`
|
||
|
||
将当前活动的场景保存为位于 ``path`` 的文件。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_select_file:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **select_file**\ (\ file\: :ref:`String<class_String>`\ ) :ref:`🔗<class_EditorInterface_method_select_file>`
|
||
|
||
在文件系统面板中选中文件,路径由 ``file`` 提供。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_set_current_feature_profile:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_current_feature_profile**\ (\ profile_name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_EditorInterface_method_set_current_feature_profile>`
|
||
|
||
使用给定的 ``profile_name`` 选择并激活指定的功能配置文件。将 ``profile_name`` 设置为空字符串以重置为默认功能配置文件。
|
||
|
||
可以使用 :ref:`EditorFeatureProfile<class_EditorFeatureProfile>` 类以编程方式创建功能配置文件。
|
||
|
||
\ **注意:**\ 激活的功能配置文件必须位于 ``feature_profiles`` 目录中,且该文件的扩展名为 ``.profile``\ 。如果找不到配置文件,则会发生错误。可以使用 :ref:`EditorPaths.get_config_dir()<class_EditorPaths_method_get_config_dir>` 找到编辑器配置文件夹。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_set_main_screen_editor:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_main_screen_editor**\ (\ name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_EditorInterface_method_set_main_screen_editor>`
|
||
|
||
将编辑器的当前主屏幕设置为 ``name`` 中指定的屏幕。\ ``name`` 必须与相关选项卡的文本完全匹配(默认选项卡为 ``2D``\ 、\ ``3D``\ 、\ ``Script``\ 、\ ``Game``\ 、\ ``AssetLib``\ )。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_set_object_edited:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_object_edited**\ (\ object\: :ref:`Object<class_Object>`, edited\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorInterface_method_set_object_edited>`
|
||
|
||
If ``edited`` is ``true``, the object is marked as edited.
|
||
|
||
\ **Note:** This is primarily used by the editor for :ref:`Resource<class_Resource>` based objects to track their modified state. For example, any changes to an open scene, a resource in the inspector, or an edited script will cause this method to be called with ``true``. Saving the scene, script, or resource resets the edited state by calling this method with ``false``.
|
||
|
||
\ **Note:** Each call to this method increments the object's edited version. This is used to track changes in the editor and to trigger when thumbnails should be regenerated for resources.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_set_plugin_enabled:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_plugin_enabled**\ (\ plugin\: :ref:`String<class_String>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorInterface_method_set_plugin_enabled>`
|
||
|
||
设置插件的启用状态。插件名称与其目录名称相同。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorInterface_method_stop_playing_scene:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **stop_playing_scene**\ (\ ) :ref:`🔗<class_EditorInterface_method_stop_playing_scene>`
|
||
|
||
停止当前正在播放的场景。
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||
.. |static| replace:: :abbr:`static (调用本方法无需实例,可直接使用类名进行调用。)`
|
||
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效运算符。)`
|
||
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列位标志构成位掩码的整数。)`
|
||
.. |void| replace:: :abbr:`void (无返回值。)`
|