Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
EditorFeatureProfile¶
继承: RefCounted < Object
编辑器功能配置,可用于禁用特定功能。
描述¶
编辑器功能配置可以用来禁用 Godot 编辑器的特定功能。当禁用时,这些功能将不会出现在编辑器中,从而使编辑器不那么混乱。这个设置使编辑器更简洁,在团队中工作时。例如,游戏美术和关卡设计师可以使用禁用脚本编辑器的功能配置,以避免意外地对他们不应该编辑的文件进行更改。
要可视化地管理编辑器功能配置,请使用编辑器窗口顶部的编辑器 >管理功能配置...。
方法¶
get_feature_name ( Feature feature ) |
|
is_class_disabled ( StringName class_name ) const |
|
is_class_editor_disabled ( StringName class_name ) const |
|
is_class_property_disabled ( StringName class_name, StringName property ) const |
|
is_feature_disabled ( Feature feature ) const |
|
load_from_file ( String path ) |
|
save_to_file ( String path ) |
|
void |
set_disable_class ( StringName class_name, bool disable ) |
void |
set_disable_class_editor ( StringName class_name, bool disable ) |
void |
set_disable_class_property ( StringName class_name, StringName property, bool disable ) |
void |
set_disable_feature ( Feature feature, bool disable ) |
枚举¶
enum Feature:
Feature FEATURE_3D = 0
3D 编辑器。如果禁用此功能,3D 编辑器将不显示,但 3D 节点仍将显示在“创建新 Node”对话框中。
Feature FEATURE_SCRIPT = 1
脚本选项卡,它包含脚本编辑器和类引用浏览器。如果该功能被禁用,脚本选项卡将不会显示。
Feature FEATURE_ASSET_LIB = 2
AssetLib 选项卡。如果禁用此功能,则不会显示 AssetLib 选项卡。
Feature FEATURE_SCENE_TREE = 3
场景树编辑。如果禁用此功能,场景树面板仍将可见,但将是只读的。
Feature FEATURE_NODE_DOCK = 4
节点面板。如果此功能被禁用,信号和组将不可见,也不能从编辑器中修改。
Feature FEATURE_FILESYSTEM_DOCK = 5
文件系统面板。如果禁用此功能,则文件系统面板将不可见。
Feature FEATURE_IMPORT_DOCK = 6
导入面板。如果禁用此功能,则导入面板将不可见。
Feature FEATURE_HISTORY_DOCK = 7
历史面板。如果禁用此功能,则历史面板将不可见。
Feature FEATURE_MAX = 8
代表 Feature 枚举的大小。
方法说明¶
String get_feature_name ( Feature feature )
返回指定特性 feature
的人类可读名称。
bool is_class_disabled ( StringName class_name ) const
如果 class_name
指定的类被禁用,则返回 true
。被禁用时,该类不会出现在“创建 Node”对话框中。
bool is_class_editor_disabled ( StringName class_name ) const
如果由 class_name
指定的类的编辑被禁用,则返回 true
。被禁用时,该类仍会出现在“创建 Node”对话框中,但在选择继承该类的节点时,检查器将是只读的。
bool is_class_property_disabled ( StringName class_name, StringName property ) const
如果在 class_name
指定的类中禁用 property
,则返回 true
。当属性被禁用时,在选择继承由 class_name
指定的类的节点时,该属性将不会出现在检查器中。
bool is_feature_disabled ( Feature feature ) const
如果 feature
被禁用,则返回 true
。当一个功能被禁用时,它将从编辑器中完全消失。
Error load_from_file ( String path )
从文件加载编辑器功能配置文件。该文件必须遵循使用功能配置文件管理器的导出按钮或 save_to_file 方法获取的 JSON 格式。
注意:通过用户界面创建的功能配置文件将从 feature_profiles
目录中的扩展名为 .profile
的文件加载。可以使用 EditorPaths.get_config_dir 找到编辑器配置文件夹。
Error save_to_file ( String path )
将编辑器功能配置文件保存到一个 JSON 格式的文件中。然后可以使用功能配置文件管理器的导入按钮或 load_from_file 方法导入它。
注意:通过用户界面创建的功能配置文件,将作为扩展名为 .profile
的文件,保存在 feature_profiles
目录中。可以使用 EditorPaths.get_config_dir 找到编辑器配置文件夹。
void set_disable_class ( StringName class_name, bool disable )
如果 disable
为 true
,则禁用 class_name
指定的类。禁用后,该类不会出现在“创建新 Node”对话框中。
void set_disable_class_editor ( StringName class_name, bool disable )
如果 disable
为 true
,则禁用 class_name
指定的类的编辑。禁用后,该类仍然会出现在“创建新 Node”对话框中,但在选中继承的节点时,检查器将只读。
void set_disable_class_property ( StringName class_name, StringName property, bool disable )
如果 disable
为 true
,则禁用 class_name
指定的类中的 property
属性的编辑。禁用某一属性后,选中继承自 class_name
指定的类的节点时,这个属性将不会出现在检查器中。
void set_disable_feature ( Feature feature, bool disable )
如果 disable
为 true
,则禁用 feature
中指定的编辑器功能。当一个功能被禁用时,它将从编辑器中完全消失。