Files
godot-docs-l10n/classes/zh_Hans/class_editorfeatureprofile.rst
Rémi Verschelde c3f2364c10 Sync classref with 4.6 branch
Lots of translations invalidated (fuzzied) as we just synced Weblate.
2025-12-19 16:39:51 +01:00

316 lines
18 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:github_url: hide
.. _class_EditorFeatureProfile:
EditorFeatureProfile
====================
**继承:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
编辑器功能配置,可用于禁用特定功能。
.. rst-class:: classref-introduction-group
描述
----
编辑器功能配置可以用来禁用 Godot 编辑器的特定功能。当禁用时,这些功能将不会出现在编辑器中,从而使编辑器不那么混乱。这个设置使编辑器更简洁,在团队中工作时。例如,游戏美术和关卡设计师可以使用禁用脚本编辑器的功能配置,以避免意外地对他们不应该编辑的文件进行更改。
要可视化地管理编辑器功能配置,请使用编辑器窗口顶部的\ **编辑器 >管理功能配置...**\ 。
.. rst-class:: classref-reftable-group
方法
----
.. table::
:widths: auto
+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_feature_name<class_EditorFeatureProfile_method_get_feature_name>`\ (\ feature\: :ref:`Feature<enum_EditorFeatureProfile_Feature>`\ ) |
+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_class_disabled<class_EditorFeatureProfile_method_is_class_disabled>`\ (\ class_name\: :ref:`StringName<class_StringName>`\ ) |const| |
+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_class_editor_disabled<class_EditorFeatureProfile_method_is_class_editor_disabled>`\ (\ class_name\: :ref:`StringName<class_StringName>`\ ) |const| |
+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_class_property_disabled<class_EditorFeatureProfile_method_is_class_property_disabled>`\ (\ class_name\: :ref:`StringName<class_StringName>`, property\: :ref:`StringName<class_StringName>`\ ) |const| |
+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_feature_disabled<class_EditorFeatureProfile_method_is_feature_disabled>`\ (\ feature\: :ref:`Feature<enum_EditorFeatureProfile_Feature>`\ ) |const| |
+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_from_file<class_EditorFeatureProfile_method_load_from_file>`\ (\ path\: :ref:`String<class_String>`\ ) |
+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_to_file<class_EditorFeatureProfile_method_save_to_file>`\ (\ path\: :ref:`String<class_String>`\ ) |
+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_disable_class<class_EditorFeatureProfile_method_set_disable_class>`\ (\ class_name\: :ref:`StringName<class_StringName>`, disable\: :ref:`bool<class_bool>`\ ) |
+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_disable_class_editor<class_EditorFeatureProfile_method_set_disable_class_editor>`\ (\ class_name\: :ref:`StringName<class_StringName>`, disable\: :ref:`bool<class_bool>`\ ) |
+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_disable_class_property<class_EditorFeatureProfile_method_set_disable_class_property>`\ (\ class_name\: :ref:`StringName<class_StringName>`, property\: :ref:`StringName<class_StringName>`, disable\: :ref:`bool<class_bool>`\ ) |
+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_disable_feature<class_EditorFeatureProfile_method_set_disable_feature>`\ (\ feature\: :ref:`Feature<enum_EditorFeatureProfile_Feature>`, disable\: :ref:`bool<class_bool>`\ ) |
+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
枚举
----
.. _enum_EditorFeatureProfile_Feature:
.. rst-class:: classref-enumeration
enum **Feature**: :ref:`🔗<enum_EditorFeatureProfile_Feature>`
.. _class_EditorFeatureProfile_constant_FEATURE_3D:
.. rst-class:: classref-enumeration-constant
:ref:`Feature<enum_EditorFeatureProfile_Feature>` **FEATURE_3D** = ``0``
3D 编辑器。如果禁用此功能3D 编辑器将不显示,但 3D 节点仍将显示在“创建新 Node”对话框中。
.. _class_EditorFeatureProfile_constant_FEATURE_SCRIPT:
.. rst-class:: classref-enumeration-constant
:ref:`Feature<enum_EditorFeatureProfile_Feature>` **FEATURE_SCRIPT** = ``1``
脚本选项卡,它包含脚本编辑器和类引用浏览器。如果该功能被禁用,脚本选项卡将不会显示。
.. _class_EditorFeatureProfile_constant_FEATURE_ASSET_LIB:
.. rst-class:: classref-enumeration-constant
:ref:`Feature<enum_EditorFeatureProfile_Feature>` **FEATURE_ASSET_LIB** = ``2``
AssetLib 选项卡。如果禁用此功能,则不会显示 AssetLib 选项卡。
.. _class_EditorFeatureProfile_constant_FEATURE_SCENE_TREE:
.. rst-class:: classref-enumeration-constant
:ref:`Feature<enum_EditorFeatureProfile_Feature>` **FEATURE_SCENE_TREE** = ``3``
场景树编辑。如果禁用此功能,场景树面板仍将可见,但将是只读的。
.. _class_EditorFeatureProfile_constant_FEATURE_NODE_DOCK:
.. rst-class:: classref-enumeration-constant
:ref:`Feature<enum_EditorFeatureProfile_Feature>` **FEATURE_NODE_DOCK** = ``4``
**已弃用:** Replaced by the Signals and Groups docks.
节点面板。如果此功能被禁用,信号和组将不可见,也不能从编辑器中修改。
.. _class_EditorFeatureProfile_constant_FEATURE_FILESYSTEM_DOCK:
.. rst-class:: classref-enumeration-constant
:ref:`Feature<enum_EditorFeatureProfile_Feature>` **FEATURE_FILESYSTEM_DOCK** = ``5``
文件系统面板。如果禁用此功能,则文件系统面板将不可见。
.. _class_EditorFeatureProfile_constant_FEATURE_IMPORT_DOCK:
.. rst-class:: classref-enumeration-constant
:ref:`Feature<enum_EditorFeatureProfile_Feature>` **FEATURE_IMPORT_DOCK** = ``6``
导入面板。如果禁用此功能,则导入面板将不可见。
.. _class_EditorFeatureProfile_constant_FEATURE_HISTORY_DOCK:
.. rst-class:: classref-enumeration-constant
:ref:`Feature<enum_EditorFeatureProfile_Feature>` **FEATURE_HISTORY_DOCK** = ``7``
历史面板。如果禁用此功能,则历史面板将不可见。
.. _class_EditorFeatureProfile_constant_FEATURE_GAME:
.. rst-class:: classref-enumeration-constant
:ref:`Feature<enum_EditorFeatureProfile_Feature>` **FEATURE_GAME** = ``8``
游戏选项卡,能够在其中嵌入游戏窗口,在游戏窗口中通过点击选择节点。如果禁用此功能,则不会显示游戏选项卡。
.. _class_EditorFeatureProfile_constant_FEATURE_SIGNALS_DOCK:
.. rst-class:: classref-enumeration-constant
:ref:`Feature<enum_EditorFeatureProfile_Feature>` **FEATURE_SIGNALS_DOCK** = ``9``
The Signals dock. If this feature is disabled, signals won't be visible and modifiable from the editor.
.. _class_EditorFeatureProfile_constant_FEATURE_GROUPS_DOCK:
.. rst-class:: classref-enumeration-constant
:ref:`Feature<enum_EditorFeatureProfile_Feature>` **FEATURE_GROUPS_DOCK** = ``10``
The Groups dock. If this feature is disabled, groups won't be visible and modifiable from the editor.
.. _class_EditorFeatureProfile_constant_FEATURE_MAX:
.. rst-class:: classref-enumeration-constant
:ref:`Feature<enum_EditorFeatureProfile_Feature>` **FEATURE_MAX** = ``11``
代表 :ref:`Feature<enum_EditorFeatureProfile_Feature>` 枚举的大小。
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
方法说明
--------
.. _class_EditorFeatureProfile_method_get_feature_name:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_feature_name**\ (\ feature\: :ref:`Feature<enum_EditorFeatureProfile_Feature>`\ ) :ref:`🔗<class_EditorFeatureProfile_method_get_feature_name>`
返回指定特性 ``feature`` 的人类可读名称。
.. rst-class:: classref-item-separator
----
.. _class_EditorFeatureProfile_method_is_class_disabled:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_class_disabled**\ (\ class_name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_EditorFeatureProfile_method_is_class_disabled>`
如果 ``class_name`` 指定的类被禁用,则返回 ``true``\ 。被禁用时,该类不会出现在“创建 Node”对话框中。
.. rst-class:: classref-item-separator
----
.. _class_EditorFeatureProfile_method_is_class_editor_disabled:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_class_editor_disabled**\ (\ class_name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_EditorFeatureProfile_method_is_class_editor_disabled>`
如果由 ``class_name`` 指定的类的编辑被禁用,则返回 ``true``\ 。被禁用时,该类仍会出现在“创建 Node”对话框中但在选择继承该类的节点时检查器将是只读的。
.. rst-class:: classref-item-separator
----
.. _class_EditorFeatureProfile_method_is_class_property_disabled:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_class_property_disabled**\ (\ class_name\: :ref:`StringName<class_StringName>`, property\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_EditorFeatureProfile_method_is_class_property_disabled>`
如果在 ``class_name`` 指定的类中禁用 ``property``\ ,则返回 ``true``\ 。当属性被禁用时,在选择继承由 ``class_name`` 指定的类的节点时,该属性将不会出现在检查器中。
.. rst-class:: classref-item-separator
----
.. _class_EditorFeatureProfile_method_is_feature_disabled:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_feature_disabled**\ (\ feature\: :ref:`Feature<enum_EditorFeatureProfile_Feature>`\ ) |const| :ref:`🔗<class_EditorFeatureProfile_method_is_feature_disabled>`
如果 ``feature`` 被禁用,则返回 ``true``\ 。当一个功能被禁用时,它将从编辑器中完全消失。
.. rst-class:: classref-item-separator
----
.. _class_EditorFeatureProfile_method_load_from_file:
.. rst-class:: classref-method
:ref:`Error<enum_@GlobalScope_Error>` **load_from_file**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_EditorFeatureProfile_method_load_from_file>`
从文件加载编辑器功能配置文件。该文件必须遵循使用功能配置文件管理器的\ **导出**\ 按钮或 :ref:`save_to_file()<class_EditorFeatureProfile_method_save_to_file>` 方法获取的 JSON 格式。
\ **注意:**\ 通过用户界面创建的功能配置文件将从 ``feature_profiles`` 目录中的扩展名为 ``.profile`` 的文件加载。可以使用 :ref:`EditorPaths.get_config_dir()<class_EditorPaths_method_get_config_dir>` 找到编辑器配置文件夹。
.. rst-class:: classref-item-separator
----
.. _class_EditorFeatureProfile_method_save_to_file:
.. rst-class:: classref-method
:ref:`Error<enum_@GlobalScope_Error>` **save_to_file**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_EditorFeatureProfile_method_save_to_file>`
将编辑器功能配置文件保存到一个 JSON 格式的文件中。然后可以使用功能配置文件管理器的\ **导入**\ 按钮或 :ref:`load_from_file()<class_EditorFeatureProfile_method_load_from_file>` 方法导入它。
\ **注意:**\ 通过用户界面创建的功能配置文件,将作为扩展名为 ``.profile`` 的文件,保存在 ``feature_profiles`` 目录中。可以使用 :ref:`EditorPaths.get_config_dir()<class_EditorPaths_method_get_config_dir>` 找到编辑器配置文件夹。
.. rst-class:: classref-item-separator
----
.. _class_EditorFeatureProfile_method_set_disable_class:
.. rst-class:: classref-method
|void| **set_disable_class**\ (\ class_name\: :ref:`StringName<class_StringName>`, disable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorFeatureProfile_method_set_disable_class>`
如果 ``disable````true``\ ,则禁用 ``class_name`` 指定的类。禁用后,该类不会出现在“创建新 Node”对话框中。
.. rst-class:: classref-item-separator
----
.. _class_EditorFeatureProfile_method_set_disable_class_editor:
.. rst-class:: classref-method
|void| **set_disable_class_editor**\ (\ class_name\: :ref:`StringName<class_StringName>`, disable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorFeatureProfile_method_set_disable_class_editor>`
如果 ``disable````true``\ ,则禁用 ``class_name`` 指定的类的编辑。禁用后,该类仍然会出现在“创建新 Node”对话框中但在选中继承的节点时检查器将只读。
.. rst-class:: classref-item-separator
----
.. _class_EditorFeatureProfile_method_set_disable_class_property:
.. rst-class:: classref-method
|void| **set_disable_class_property**\ (\ class_name\: :ref:`StringName<class_StringName>`, property\: :ref:`StringName<class_StringName>`, disable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorFeatureProfile_method_set_disable_class_property>`
如果 ``disable````true``\ ,则禁用 ``class_name`` 指定的类中的 ``property`` 属性的编辑。禁用某一属性后,选中继承自 ``class_name`` 指定的类的节点时,这个属性将不会出现在检查器中。
.. rst-class:: classref-item-separator
----
.. _class_EditorFeatureProfile_method_set_disable_feature:
.. rst-class:: classref-method
|void| **set_disable_feature**\ (\ feature\: :ref:`Feature<enum_EditorFeatureProfile_Feature>`, disable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorFeatureProfile_method_set_disable_feature>`
如果 ``disable````true``\ ,则禁用 ``feature`` 中指定的编辑器功能。当一个功能被禁用时,它将从编辑器中完全消失。
.. |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 (无返回值。)`