diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-08-24 08:28:53 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-08-24 08:29:40 -0300 |
commit | 0161e95f01a6a9c096eec75328e4f19c23cf5c25 (patch) | |
tree | a7a60a73d77fdb1d45159dc8f107b3ce86f37b8a /editor/plugins/skeleton_editor_plugin.cpp | |
parent | f123694b4e5ac52bb82b3a2e3cbd6d36db1d0c9c (diff) |
some checks for node removed, may fix #20863
Diffstat (limited to 'editor/plugins/skeleton_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/skeleton_editor_plugin.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/editor/plugins/skeleton_editor_plugin.cpp b/editor/plugins/skeleton_editor_plugin.cpp index fe7d1df50c..d871922c8b 100644 --- a/editor/plugins/skeleton_editor_plugin.cpp +++ b/editor/plugins/skeleton_editor_plugin.cpp @@ -126,7 +126,15 @@ PhysicalBone *SkeletonEditor::create_physical_bone(int bone_id, int bone_child_i } void SkeletonEditor::edit(Skeleton *p_node) { + skeleton = p_node; + +} + +void SkeletonEditor::_notification(int p_what) { + if (p_what==NOTIFICATION_ENTER_TREE) { + get_tree()->connect("node_removed", this, "_node_removed"); + } } void SkeletonEditor::_node_removed(Node *p_node) { @@ -139,6 +147,7 @@ void SkeletonEditor::_node_removed(Node *p_node) { void SkeletonEditor::_bind_methods() { ClassDB::bind_method("_on_click_option", &SkeletonEditor::_on_click_option); + ClassDB::bind_method("_node_removed", &SkeletonEditor::_node_removed); } SkeletonEditor::SkeletonEditor() { |