mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 09:01:32 +00:00
Add null checks to AnimationTreeEditors and _clear_editors()
This commit is contained in:
parent
bc5d67c613
commit
b0eb3b6ebd
7 changed files with 138 additions and 57 deletions
|
|
@ -77,6 +77,7 @@ void AnimationTreeEditor::edit(AnimationTree *p_tree) {
|
|||
void AnimationTreeEditor::_node_removed(Node *p_node) {
|
||||
if (p_node == tree) {
|
||||
tree = nullptr;
|
||||
_clear_editors();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -151,7 +152,6 @@ void AnimationTreeEditor::edit_path(const Vector<String> &p_path) {
|
|||
} else {
|
||||
current_root = ObjectID();
|
||||
edited_path = button_path;
|
||||
|
||||
for (int i = 0; i < editors.size(); i++) {
|
||||
editors[i]->edit(Ref<AnimationNode>());
|
||||
editors[i]->hide();
|
||||
|
|
@ -161,6 +161,17 @@ void AnimationTreeEditor::edit_path(const Vector<String> &p_path) {
|
|||
_update_path();
|
||||
}
|
||||
|
||||
void AnimationTreeEditor::_clear_editors() {
|
||||
button_path.clear();
|
||||
current_root = ObjectID();
|
||||
edited_path = button_path;
|
||||
for (int i = 0; i < editors.size(); i++) {
|
||||
editors[i]->edit(Ref<AnimationNode>());
|
||||
editors[i]->hide();
|
||||
}
|
||||
_update_path();
|
||||
}
|
||||
|
||||
Vector<String> AnimationTreeEditor::get_edited_path() const {
|
||||
return button_path;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue