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...
EditorSelection
继承: Object
管理编辑器中的 SceneTree 选择。
描述
这个对象管理编辑器中的 SceneTree 选择。
注意:这个类不应该直接实例化。相反,使用EditorInterface.get_selection()访问单例。
方法
void |
|
void |
clear() |
void |
remove_node(node: Node) |
信号
selection_changed() 🔗
更改选择时发出。
方法说明
将一个节点添加到选择中。
注意:新选择的节点不会在检查器中自动被编辑。如果你想编辑一个节点,请使用 EditorInterface.edit_node()。
void clear() 🔗
清除选中项。
Array[Node] get_selected_nodes() 🔗
返回所选节点的列表。
Array[Node] get_top_selected_nodes() 🔗
返回仅包含顶层选定节点的列表,不包括任何子节点。适用于执行变换操作(移动、旋转等)。
例如节点 A 有一个子节点 B、一个同级节点 C,如果选中这三个节点,那么该方法只会返回 A 和 C。更改 A 的全局变换将影响 B 的全局变换,因此不需要单独更改 B。
Array[Node] get_transformable_selected_nodes() 🔗
已弃用: Use get_top_selected_nodes() instead.
返回仅包含顶层选定节点的列表,不包括任何子节点。适用于执行变换操作(移动、旋转等)。见 get_top_selected_nodes()。
void remove_node(node: Node) 🔗
从选择中删除一个节点。