EditorSelection

继承: Object

在编辑器中管理SceneTree选择。

描述

此对象管理编辑器中的SceneTree选择。

注意:这个类不应该直接实例化。相反,使用EditorInterface.get_selection()访问单例。

方法


信号

selection_changed() 🔗

选择更改时发出。


方法说明

void add_node(node: Item) 🔗

将节点添加到选择中。

注意:新选择的节点不会在检查器中自动编辑。如果要编辑节点,请使用EditorInterface.edit_node()


void clear() 🔗

清除选择。


Array[Item] get_selected_nodes() 🔗

返回选定节点的列表。


Array[Item] get_transformable_selected_nodes() 🔗

返回选定节点的列表,针对转换操作进行了优化(即移动它们、旋转等)。此列表可用于避免选择节点并且也是子/孙节点的情况。


void remove_node(node: Item) 🔗

从选择中删除一个节点。