📜  如何在 godot 中创建新节点 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:33.052000             🧑  作者: Mango

代码示例1
var node = Spatial.new()
# the parent can be get_tree().get_root() or some other node
parent.add_child(node)
# ownership is different, I think it's not the same root as the root node
node.set_owner(get_tree().get_edited_scene_root())