Unregister BT instance with debugger if BTPlayer is removed from tree
This commit is contained in:
parent
91edd1c0b5
commit
869b6465b9
|
@ -80,7 +80,7 @@ void BTPlayer::set_behavior_tree(const Ref<BehaviorTree> &p_tree) {
|
||||||
_update_blackboard_plan();
|
_update_blackboard_plan();
|
||||||
} else {
|
} else {
|
||||||
behavior_tree = p_tree;
|
behavior_tree = p_tree;
|
||||||
if (get_owner()) {
|
if (get_owner() && is_inside_tree()) {
|
||||||
_load_tree();
|
_load_tree();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,6 +170,7 @@ void BTPlayer::_notification(int p_notification) {
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
if (bt_instance.is_valid()) {
|
if (bt_instance.is_valid()) {
|
||||||
bt_instance->set_monitor_performance(monitor_performance);
|
bt_instance->set_monitor_performance(monitor_performance);
|
||||||
|
bt_instance->register_with_debugger();
|
||||||
}
|
}
|
||||||
#endif // DEBUG_ENABLED
|
#endif // DEBUG_ENABLED
|
||||||
} break;
|
} break;
|
||||||
|
@ -177,6 +178,7 @@ void BTPlayer::_notification(int p_notification) {
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
if (bt_instance.is_valid()) {
|
if (bt_instance.is_valid()) {
|
||||||
bt_instance->set_monitor_performance(false);
|
bt_instance->set_monitor_performance(false);
|
||||||
|
bt_instance->unregister_with_debugger();
|
||||||
}
|
}
|
||||||
#endif // DEBUG_ENABLED
|
#endif // DEBUG_ENABLED
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue